Details
-
Bug
-
Resolution: Done
-
Minor - P4
-
2.0.2
-
ALL
Description
Given a small collection with these values:
> db.test.find()
|
{ "_id" : ObjectId("4f3ade128e2fc474150d9afd"), "x" : 1, "y" : 2 }
|
{ "_id" : ObjectId("4f3ade168e2fc474150d9afe"), "x" : 3, "y" : 4 }
|
{ "_id" : ObjectId("4f3adec28e2fc474150d9aff"), "x" : 5, "y" : 6 }
|
>
|
This simple query gives the obvious results:
> db.test.find({x:1,y:2})
|
{ "_id" : ObjectId("4f3ade128e2fc474150d9afd"), "x" : 1, "y" : 2 }
|
>
|
But why doesn't this query using $not work?
> db.test.find({$not:{x:1,y:2}})
|
>
|
I expected it to simply return all the documents that didn't match the first time.
If this usage of $not is not supported then an error should be returned.
Attachments
Issue Links
- depends on
-
SERVER-6650 should matcher prevent use of $ prefixed field names?
-
- Closed
-
- is related to
-
SERVER-7391 Parse bson queries into new MatchExpression AST
-
- Closed
-