[SERVER-3264] missing field matches against [null] for both $in and $nin Created: 15/Jun/11 Updated: 12/Jul/16 Resolved: 14/Sep/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 1.8.1 |
| Fix Version/s: | 2.1.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Sarva Bryant | Assignee: | Aaron Staple |
| Resolution: | Done | Votes: | 0 |
| Labels: | query | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Ubuntu 10.10 amd64 |
||
| Backwards Compatibility: | Minor Change |
| Operating System: | Linux |
| Participants: |
| Description |
|
As seen below when a field is missing from the document, a null value in the array returns true for both $in and $nin. If a missing value is equivalent to null, then $in is performing as expected and $nin should be returning false. > db.test.insert({}) > db.test.find({"test": {$in: [null]}}) { "_id" : ObjectId("4df8062a2c1a2033b886d0b5") }> db.test.find({"test": {$nin: [null]}}) { "_id" : ObjectId("4df8062a2c1a2033b886d0b5") } |
| Comments |
| Comment by auto [ 13/Sep/11 ] |
|
Author: {u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}Message: |
| Comment by auto [ 13/Sep/11 ] |
|
Author: {u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}Message: |