-
Type: Question
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Querying
-
None
Right now if someone attempts to use an aggregation expression inside a query or inside a $match, they will see results different from what they expect (and no error):
t = db.t; t.drop(); t.save( { a:1, b:5 } ); printjson( t.find( { a:1, b:{ $gt:{ $add:[ 1, 1 ] } } } ).toArray() ); printjson( t.aggregate( { $match:{ a:1, b:{ $gt:{ $add:[ 1, 1 ] } } } } ) );
In both cases
{ $add:[ 1, 1 ] }is treated as a document to compare against, not an expression to be evaluated.
- is depended on by
-
SERVER-4973 $not should return error if used as a top-level key in query document
- Closed