Skip to content

Commit

Permalink
Merge pull request #884 from materialsproject/bugfix/agg_kwargs
Browse files Browse the repository at this point in the history
Fix aggregation pipeline kwargs
  • Loading branch information
munrojm committed Nov 9, 2023
2 parents a28d964 + 5dd4e88 commit 3ab45f4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/maggma/api/resource/read_resource.py
Expand Up @@ -237,10 +237,15 @@ def search(**queries: Dict[str, STORE_PARAMS]) -> Union[Dict, Response]:
else:
pipeline = generate_query_pipeline(query, self.store)

agg_kwargs = {}

if query.get("agg_hint"):
agg_kwargs["hint"] = query["agg_hint"]

data = list(
self.store._collection.aggregate(
pipeline,
hint = query.get("agg_hint"),
**agg_kwargs
)
)

Expand Down

0 comments on commit 3ab45f4

Please sign in to comment.