[SERVER-413] Queries with $exists operator on indexed key return on results Created: 11/Nov/09  Updated: 12/Jul/16  Resolved: 11/Nov/09

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 1.0.0, 1.0.1
Fix Version/s: 1.1.4

Type: Bug Priority: Critical - P2
Reporter: Emily Price Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mac OS X 10.5.8 on MacBook Pro
Tested on MongoDB releases mongodb-osx-x86_64-1.0.0 and mongodb-osx-x86_64-1.0.1


Attachments: File mongo_problem_spec.rb    
Participants:

 Description   

It seems that the $exists operator does not work on keys which have been indexed. If a key has an index, the $exists operator will never return any documents. I've attached some tests in ruby which demonstrate this, along with their output, and an example mongo console session showing that it's not just an issue with the ruby driver.



 Comments   
Comment by Eliot Horowitz (Inactive) [ 11/Nov/09 ]

this has already been fixed in 1.1.x
definitely fixed in 1.1.3
added more thorough tests in jstests/exists.js

Comment by auto [ 11/Nov/09 ]

Author:

{'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}

Message: tests to verify SERVER-413
http://github.com/mongodb/mongo/commit/dbf7bce04ba69677236ebc570f36050fd3bc4fa3

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