> use mongo_bug > db.bug_collection.ensureIndex({"nested.key2": 1}, {sparse: true}) > db.bug_collection.insert({key: 'a'}) > db.bug_collection.insert({key: 'b'}) > db.bug_collection.insert({key: 'c'}) > db.bug_collection.find({}) { "_id" : ObjectId("4f0e7daf9be3426d0ba2e7b8"), "key" : "a" } { "_id" : ObjectId("4f0e7db59be3426d0ba2e7b9"), "key" : "b" } { "_id" : ObjectId("4f0e7dba9be3426d0ba2e7ba"), "key" : "c" } > db.bug_collection.find({key: {$in: ['a', 'b', 'c']}, "nested.key2": {$ne: 'd'}}) # No results returned (expected, because of the sparse index?) > db.bug_collection.find({key: {$in: ['a', 'b', 'c']}}) # No results returned (NOT expected) > db.bug_collection.dropIndex("nested.key2_1") { "nIndexesWas" : 2, "ok" : 1 } > db.bug_collection.find({key: {$in: ['a', 'b', 'c']}}) { "_id" : ObjectId("4f0e7daf9be3426d0ba2e7b8"), "key" : "a" } { "_id" : ObjectId("4f0e7db59be3426d0ba2e7b9"), "key" : "b" } { "_id" : ObjectId("4f0e7dba9be3426d0ba2e7ba"), "key" : "c" } #Query now works, after the index has been dropped. The order of the queries also matters: > db.bug_collection.dropIndex("nested.key2_1") { "nIndexesWas" : 2, "ok" : 1 } > db.bug_collection.ensureIndex({"nested.key2": 1}, {sparse: true}) > db.bug_collection.find({key: {$in: ['a', 'b', 'c']}}) { "_id" : ObjectId("4f0e811f89fc95d0a1a0356b"), "key" : "a" } { "_id" : ObjectId("4f0e812389fc95d0a1a0356c"), "key" : "b" } { "_id" : ObjectId("4f0e812589fc95d0a1a0356d"), "key" : "c" } # Results returned (expected) > db.bug_collection.find({key: {$in: ['a', 'b', 'c']}, "nested.key2": {$ne: 'd'}}) { "_id" : ObjectId("4f0e811f89fc95d0a1a0356b"), "key" : "a" } { "_id" : ObjectId("4f0e812389fc95d0a1a0356c"), "key" : "b" } { "_id" : ObjectId("4f0e812589fc95d0a1a0356d"), "key" : "c" } #Results returned (this same query returns nothing in first example) > db.bug_collection.dropIndex("nested.key2_1") { "nIndexesWas" : 2, "ok" : 1 } > db.bug_collection.ensureIndex({"nested.key2": 1}, {sparse: true}) > db.bug_collection.find({key: {$in: ['a', 'b', 'c']}, "nested.key2": {$ne: 'd'}}) # No results returned (as in first example) > db.bug_collection.find({key: {$in: ['a', 'b', 'c']}}) # No results returned (as in first example) It's as if the queries are considered equivalent and being cached.