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
How to search multiple feilds' "$and"? #681
Comments
I'm not sure why your solution isn't working but a workaround is to AND both conditions like this:
Alternatively you can make it cleaner by putting everything in the same $and instead of nesting:
|
It was meant to make the example a bit simpler, but it was ambiguous. In our real query scenario, it will be more complicated. I have modified my sample code. |
This should match the updated query:
It's not the prettiest thing ever but I've done a bit of testing and it seems to work properly |
Got it. Thanks a lot. |
Such as
((A>1 && C>1) or (A<5)) && ((C>1 && D<1 ) or ( C<5 ))
.For only field "A" case, we can use
But with field "B", we cannot use:
So, how we can do this?
The text was updated successfully, but these errors were encountered: