Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
Sort entries alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Jan 23, 2024
1 parent fcc0e1a commit c41b0ab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion marda_registry/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def get_filetypes():
},
# Remove the temporary `extractors` field
{"$project": {"_id": 0, "extractors": 0}},
{"$sort": {"id": 1}},
]
)
),
Expand Down Expand Up @@ -129,7 +130,7 @@ def search_file_types(query: str):
@api.get("/extractors", response_model=ExtractorEntryResponse)
def get_extractors():
return {
"data": list(db.extractors.find({}, projection={"_id": 0})),
"data": list(db.extractors.find({}, projection={"_id": 0}, sort=[("id", 1),])),
"meta": _get_info(),
}

Expand Down

0 comments on commit c41b0ab

Please sign in to comment.