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

Improve handling of sorting in MongoDB backend #276

Closed
ml-evs opened this issue May 18, 2020 · 0 comments · Fixed by #424
Closed

Improve handling of sorting in MongoDB backend #276

ml-evs opened this issue May 18, 2020 · 0 comments · Fixed by #424
Assignees
Labels
priority/medium Issue or PR with a consensus of medium priority server Issues pertaining to the example server implementation
Projects

Comments

@ml-evs
Copy link
Member

ml-evs commented May 18, 2020

Currently all fields are sort-enabled by default, and the entire ?sort= parameter is passed through to the backend. We need to wrap this in some code to handle the following cases:

  • Explicitly disallowed sorting, e.g. the model/schema has been changed to disable sorting on a field.
  • If sorting a large number of results on non-indexed fields, catch any pymongo errors and return a useful error message.

It could be generally useful to allow sorting to be configurable (by list of allowed field names, and whether to allow multiple sort keys), to better support other backends too.

@ml-evs ml-evs self-assigned this May 18, 2020
@ml-evs ml-evs added server Issues pertaining to the example server implementation priority/medium Issue or PR with a consensus of medium priority labels May 18, 2020
@ml-evs ml-evs added this to To do in CECAM 2020 via automation Jun 5, 2020
CECAM 2020 automation moved this from To do to Done Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/medium Issue or PR with a consensus of medium priority server Issues pertaining to the example server implementation
Projects
CECAM 2020
  
Done
1 participant