We allow $elemMatch clauses inside an $all as shown below, but we reject this for $in. We should allow an $in-$elemMatch query which says "the document must match one of these $elemMatch clauses".
In mongodb I can query with either $and or $or which is important for deciding whether all elements need to match or just one.
Looking at the following example provided in the mongob-docs:
you can see that one can specify - in combination with $elemMatch - that all ($all) the subqueries must match.
What I would like to do is to say that only one of these has to match, which is important for doing certain types of search-queries. I noticed though, that although for $and there is the alternative $or, this does not seem to exist for $all. I would therefore like to request something like a $any keyword which behaves like $or, but can be used like $all.
I think this is quite an important issue and shouldn't be to hard to implement - or is it?
Thanks for the great work.