-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Query language support for in array and exists #5355
Comments
Interesting, we actually don't have an This would allow the following query to work: Errors.find({
or: [
{ foo: { in: foodIds, '!': null } },
{ bar: { in: barIds, '!': null } }
]
}).exec(...) |
Thanks for posting, @nwhatt. I'm a repo bot-- nice to meet you! It has been 30 days since there have been any updates or new comments on this page. If this issue has been resolved, feel free to disregard the rest of this message. On the other hand, if you are still waiting on a patch, please:
Thanks so much for your help! |
Keeping this open until it is PRed into the roadmap. |
Looks like it was merged by @particlebanana |
Great! Thx! |
In the following where clause I want to find all of my errors that are associated with an either a specific foo or a specific bar.
When fooIds is empty or barIds is empty I get all of Errors that have no foo set.
One solution to this would be to design my db better, so that foo and bar are required on Error.
I was hoping there might be a better way outside of redesign - maybe a way to specify something like
Meaning "foo in fooIds and foo not null."
My current workaround is an if clause to dynamically construct the where clause based on whether or not my arrays are empty. Appreciate any suggestions - I may be missing a sweet query language feature.
The text was updated successfully, but these errors were encountered: