Skip to content

fix GenericReference iterable query (i.e. __in) #2886

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

terencehonles
Copy link
Contributor

This change adds the _ref or _ref.$id prefix to a query if all values in an iterable query (i.e. __in) are ObjectIds or DBRefs and raises an error for a mixed query which will only work for documents. These could possibly be compiled into an {$or: ...} query, but the automatic expansion can be added as necessary.

@terencehonles terencehonles force-pushed the fix-generic-reference-iterable-query branch from 9ca437d to b0745ca Compare May 27, 2025 16:27
This change adds the ``_ref`` or ``_ref.$id`` prefix to a query if all
values in an iterable query (i.e. ``__in``) are ``ObjectId``s or
``DBRef``s and raises an error for a mixed query which will only work
for documents. These could possibly be compiled into an ``{$or: ...}``
query, but the automatic expansion can be added as necessary.
@terencehonles terencehonles force-pushed the fix-generic-reference-iterable-query branch from b0745ca to 09b9fd3 Compare May 28, 2025 08:15
@terencehonles
Copy link
Contributor Author

This should be merged after #2887 as I've pulled that in to be able to run the CI checks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant