Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default sort parameter to MongoStore #758

Merged
merged 4 commits into from
Jan 9, 2023
Merged

Conversation

munrojm
Copy link
Member

@munrojm munrojm commented Jan 9, 2023

Adds default_sort field to MongoStore which allows for a default sort field to be specified for all queries. This enables control of determinacy in returned data.

Previously, _id was used as a default sort parameter which was causing memory issues for some queries due to MongoDB's special treatment of it when used as a sorting parameter in aggregation pipelines.

@codecov
Copy link

codecov bot commented Jan 9, 2023

Codecov Report

Base: 88.42% // Head: 88.42% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (d446906) compared to base (9fed3e7).
Patch coverage: 91.66% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #758      +/-   ##
==========================================
- Coverage   88.42%   88.42%   -0.01%     
==========================================
  Files          41       41              
  Lines        3127     3135       +8     
==========================================
+ Hits         2765     2772       +7     
- Misses        362      363       +1     
Impacted Files Coverage Δ
src/maggma/stores/mongolike.py 88.06% <91.66%> (-0.02%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@munrojm munrojm merged commit 4731ada into main Jan 9, 2023
@munrojm munrojm deleted the bugfix/default_sort branch January 9, 2023 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant