Details
-
Bug
-
Resolution: Done
-
Critical - P2
-
None
-
None
-
None
-
None
-
ALL
Description
i read the document about index of Mongodb.
It says:
An index covers (page 324) a query, a covered query, when:
• all the fields in the query (page 42) are part of that index, and
• all the fields returned in the documents that match the query are in the same index
but i ensure an index on one field, and can cover the index with the following query:
1) db.sb.ensureIndex(
)
2) db.sb.find(
).explain()
{
"cursor" : "BtreeCursor wei_1",
"isMultiKey" : false,
"n" : 1,
"nscannedObjects" : 1,
"nscanned" : 1,
"nscannedObjectsAllPlans" : 2,
"nscannedAllPlans" : 2,
"scanAndOrder" : false,
"indexOnly" : false,
"nYields" : 0,
"nChunkSkips" : 0,
"millis" : 0,
"indexBounds" :
,
"server" : "srv03.lan.sankuai.com:27017"
}
the explain show the index is covered.
anyone tell me why?