-
Type:
Bug
-
Resolution: Won't Fix
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Optimization
-
ALL
-
None
-
None
-
None
-
None
-
None
-
None
-
None
The documentation for $all says:
The $all operator selects the documents where the value of a field is an array that contains all the specified elements.
In the case of find({foo: {$all: []}}), there are no specified elements, which means that by this definition should match all documents where foo is an array (see SERVER-99070 for cases where the array clause is misleading). However, the current implementation will parse this query as $alwaysFalse.
To improve the situation, the implementation should either:
- Parse to $alwaysTrue and update the docs to remove the array clause
- Match all documents where foo is an array
- Become a parse-time error similar to {$and: []}
- is related to
-
SERVER-99070 $all with single element matches scalar
-
- Closed
-