From 430512aaa2b9fe904b44a5863c4d6098cdb560b6 Mon Sep 17 00:00:00 2001 From: munrojm Date: Mon, 6 Nov 2023 16:56:24 -0800 Subject: [PATCH] Ensure sort stage is after match in agg pipeline --- src/maggma/api/resource/utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/maggma/api/resource/utils.py b/src/maggma/api/resource/utils.py index 19a9bd115..e4bc1a958 100644 --- a/src/maggma/api/resource/utils.py +++ b/src/maggma/api/resource/utils.py @@ -54,7 +54,6 @@ def generate_query_pipeline(query: dict, store: Store): projection_dict.update({p: 1 for p in query["properties"]}) if sorting: - pipeline.append({"$project": {**projection_dict, store.key: 1}}) pipeline.append(sort_dict) pipeline.append({"$project": projection_dict})