Refers to SERVER-14662.
The behavior of the positional projection operator is undefined when there are multiple predicates over the projected array which are not joined by an $elemMatch. (Say the positional projection is {"a.b.$": 1}, then the "projected array" would be "a.b".)
The behavior is undefined in that you can't count on which array element will be returned by the projection. One of the predicates over the projected array will be used to match the nested document to project; if there is more than one predicate, then you don't know which one will be used for the match.
Let's add a warning to the positional projection documentation in order to discourage users from relying on this undefined behavior.
- is related to
-
SERVER-14662 Positional projection queries (and positional update ops) should fail with error if multiple arrays encountered
- Closed