-
Type:
Question
-
Resolution: Done
-
Priority:
Minor - P4
-
None
-
Affects Version/s: 1.4.0
-
Component/s: Index Maintenance
-
None
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
When you use the $ne operator it seems to skip the index (unless I am reading the explain wrong) is that intentional?
> db.quotations.find({noteworthy: {"$ne": false}}).limit(25).explain()
{
"cursor" : "BasicCursor",
"indexBounds" : [ ],
"nscanned" : 25,
"nscannedObjects" : 25,
"n" : 25,
"millis" : 0,
"oldPlan" :
,
"allPlans" : [
]
}
versus me changing out {$ne: false} to true (I know it isn't equivalent)
> db.quotations.find(
{noteworthy: true}).limit(25).explain()
{
"cursor" : "BtreeCursor noteworthy_1",
"indexBounds" : [
[
,
{ "noteworthy" : true } ]
],
"nscanned" : 5,
"nscannedObjects" : 5,
"n" : 5,
"millis" : 0,
"allPlans" : [
{
"cursor" : "BtreeCursor noteworthy_1",
"indexBounds" : [
[
,
{ "noteworthy" : true } ]
]
}
]
}