$in should take a list (array) of values. But it currently also accepts an object. An object should probably trigger a query parse error.
c = db.c; c.drop(); c.save( { a:1 } ); c.save( { a:2 } ); c.save( { a:3 } ); // Works printjson( c.find( { a:{ $in:[ 1, 3 ] } } ).toArray() ); // Works the same as the above line, but it should probably be uassert. printjson( c.find( { a:{ $in:{ x:1, y:3 } } } ).toArray() );
- is related to
-
SERVER-7391 Parse bson queries into new MatchExpression AST
- Closed
- related to
-
SERVER-6400 Refactor Matcher/QueryExpression
- Closed