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

"contains" filter for collections should disregard reference version if not provided #51

Open
paynejd opened this issue Mar 26, 2018 · 3 comments
Assignees
Labels
bug Something isn't working scheduled

Comments

@paynejd
Copy link
Member

paynejd commented Mar 26, 2018

Last year we added the contains parameter to filter the list of collections returned by those that contain a specified reference. For example:

https://api.staging.openconceptlab.org/orgs/PEPFAR-MOH-UG/collections/?contains=/orgs/PEPFAR-MOH-UG/sources/PEPFAR-Alignment-Indicators/concepts/mCVvMl1sIua/5ab1b25f61ce75004c1456e8/

However, it apparently only works if you include the specific version of the concept or mapping. For example, this does not work currently:

https://api.staging.openconceptlab.org/orgs/PEPFAR-MOH-UG/collections/?contains=/orgs/PEPFAR-MOH-UG/sources/PEPFAR-Alignment-Indicators/concepts/mCVvMl1sIua/

The correct behavior is that it should match the concept/mapping version if it is provided (the current behavior), but that it should match just the concept/mapping ID if no version information is provided.

@paynejd
Copy link
Member Author

paynejd commented Mar 26, 2018

FYI this applies to mappings as well as concepts. This query works as expected:

https://api.staging.openconceptlab.org/orgs/PEPFAR-MOH-UG/collections/?contains=/orgs/PEPFAR-MOH-UG/sources/PEPFAR-Alignment-Indicators/mappings/5ab1b6d561ce75004c1457c9/1/

But this one (when removing the mapping version /1/) does not:

https://api.staging.openconceptlab.org/orgs/PEPFAR-MOH-UG/collections/?contains=/orgs/PEPFAR-MOH-UG/sources/PEPFAR-Alignment-Indicators/mappings/5ab1b6d561ce75004c1457c9/

@paynejd
Copy link
Member Author

paynejd commented Mar 28, 2018

Potentially implement a strict=true parameter which would only match exactly what was passed in the contains parameter

@rkorytkowski rkorytkowski added the bug Something isn't working label Sep 19, 2018
@rkorytkowski
Copy link
Contributor

An expression is currently stored in a field in an embedded document within a collection. Our mongodb-djangoe-engine version does not support partial queries in such a structure. We would have to resort to a raw mongodb query, which then cannot be easily extended with additional filters (e.g. access restrictions). #86 needs to be implemented first, which will simplify the model and allow for such queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working scheduled
Projects
None yet
Development

No branches or pull requests

2 participants