-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.0.2
-
Component/s: Index Maintenance, Querying
-
None
-
ALL
Adding a sparse index breaks $exists queries on that field.
Sample console session:
use bug // switched to db bug db.bug.insert({a: 1}) db.bug.ensureIndex({b: 1}, {sparse: true}) db.bug.find({b: {$exists: false}}) // no result! db.bug.find({b: {$exists: false}}).hint({$natural: 1}) // { "_id" : ObjectId("4f0c337f3715b68266d07790"), "a" : 1 }
- duplicates
-
SERVER-3918 make sparse indexes error out on {$exists: false} queries
- Closed