The scanned value comes from cursor.scanned() which is not the same as the docs loaded/scanned (nscannedOjbects in explain) but is instead the indexes (entries) scanned or number of docs returned.
This can be shown easily using a covered query:
> var firstSS = db.serverStatus() > db.g.find({b:2},{ b:1, _id:0}).explain() { "cursor" : "BtreeCursor b_1", "isMultiKey" : false, "n" : 2, "nscannedObjects" : 0, "nscanned" : 2, "nscannedObjectsAllPlans" : 0, "nscannedAllPlans" : 2, ...} > db.serverStatus().metrics.document.scanned - firstSS.metrics.document.scanned 2
- duplicates
-
SERVER-12774 "nscanned" not logged anymore for queries
- Closed
- is related to
-
SERVER-17862 Unify stats reporting for log/profiler across CRUD operations
- Closed
- related to
-
SERVER-10448 Revamp explain() formatting
- Closed