Details
-
Bug
-
Status: Closed
-
Minor - P4
-
Resolution: Fixed
-
2.4.6
-
Windows 64bit, 2.4.6.
-
ALL
-
Description
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.