Details
-
Question
-
Resolution: Done
-
Major - P3
-
None
-
None
-
None
Description
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.
Attachments
Issue Links
- is depended on by
-
SERVER-4973 $not should return error if used as a top-level key in query document
-
- Closed
-