Skip to content

Commit

Permalink
sort experiments by update_time descend
Browse files Browse the repository at this point in the history
  • Loading branch information
jinyu-loopmind committed Dec 30, 2023
1 parent b4cd03f commit 426f366
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/src/apps/experiment/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async def db_get_experiment_by_user_env(db, user_id: str, env_id: str):

async def db_get_experiment_by_user(db, user_id: str):
collection = await get_experiment_collection(db)
exps = collection.find({"user_id": user_id})
exps = collection.find({"user_id": user_id}, sort=[("update_time", -1)])
return [schema.Experiment(**exp) async for exp in exps]


Expand Down

0 comments on commit 426f366

Please sign in to comment.