[SERVER-1587] $exists:false not working correctly Created: 07/Aug/10  Updated: 12/Jul/16  Resolved: 06/Apr/11

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 1.6.0
Fix Version/s: 1.9.0

Type: Bug Priority: Major - P3
Reporter: david ash Assignee: Aaron Staple
Resolution: Done Votes: 5
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu 10.4 64-bit


Issue Links:
Depends
is depended on by SERVER-1735 Inconsistent behaviour for $exists: f... Closed
Related
Backwards Compatibility: Major Change
Operating System: Linux
Participants:

 Description   

When running a query with an $exists, a value of false causes the query to return 0 results.

db.foo.find({value:{$exists:false}});

The only fix I found was using $not with an $exists:true

db.foo.find({$not:{value:{$exists:true}}})



 Comments   
Comment by Aaron Staple [ 05/Apr/11 ]

I believe the examples here were fixed in SERVER-1701.

Comment by auto [ 05/Apr/11 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: SERVER-1587 add tests
Branch: master
https://github.com/mongodb/mongo/commit/74086c6f40a39a34b3ba034ed82b695cc4758f37

Comment by Visnu Pitiyanuvath [ 02/Feb/11 ]

another similar bug at SERVER-2470 (closed as duplicate), but manifesting itself in a specific way, and with a small reproduce case.

Comment by Andrea Spacca [ 10/Sep/10 ]

I opened a similar ticket few days ago: http://jira.mongodb.org/browse/SERVER-1735

Just to inform people

Generated at Thu Feb 08 02:57:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.