Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
3.2.12
-
None
-
ALL
Description
I have this line in the log file as a slow query:
2017-03-20T08:01:20.414+0000 I COMMAND [conn2424] command jidariDevDB.people_you_may_know command: find { find: "people_you_may_know", filter: { User: ObjectId('57042936377c2e29146b6386'), SuggestedUser: ObjectId('565d3e3b367c2ea030e016d5') }, projection: { Metadata: 1, Source: 1, Unread: 1, LastUpdated: 1, Points: 1 }, limit: 1, batchSize: 0, shardVersion: [ Timestamp 0|0, ObjectId('000000000000000000000000') ] } planSummary: IXSCAN { SuggestedUser: 1.0, User: 1.0 } cursorid:325486549227 keysExamined:1 docsExamined:1 keyUpdates:0 writeConflicts:0 numYields:0 nreturned:0 reslen:234 locks:{ Global: { acquireCount: { r: 2 } }, Database: { acquireCount: { r: 1 } }, Collection: { acquireCount: { r: 1 } } } protocol:op_command 886ms
|
As we can see the query is indexed and the keys exist and the document exists since "keysExamined:1 docsExamined:1".
My question is how nreturned is 0? Should not nreturned be 1?
I have also verified this by:
db.people_you_may_know.find({ User: ObjectId('57042936377c2e29146b6386'), SuggestedUser: ObjectId('565d3e3b367c2ea030e016d5') }, { Metadata: 1, Source: 1, Unread: 1, LastUpdated: 1, Points: 1 }).explain("executionStats")
|
and got:
"executionStats" : {
|
"executionSuccess" : true,
|
"nReturned" : 1,
|
"executionTimeMillis" : 280,
|
"totalKeysExamined" : 1,
|
"totalDocsExamined" : 1,
|
Why does the log file report that nreturned = 0?