-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 2.4.6
-
Component/s: Querying
-
Environment:Windows 64bit, 2.4.6.
-
ALL
-
Mongo allegedly uses an implicit AND when quering comma-separated fields of the form:
coll.find({k1:v1, k2:v2})
Thus the above should be equivalent in all senses to:
coll.find({$and: [{k1:v1}, {k2:v2}]})
However, including the explicit $and alters the indexing behaviour of the search. Using the below steps, the explicit $and uses only the _id index, whereas the implicit $and utilises other indexes. Trying to force the explicit $and to use the index that the implicit version is using (with .hint()) does not work.