Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-28423

Log file says nreturned is 0 when it cannot be 0

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 3.2.12
    • Logging
    • 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?

      Attachments

        Activity

          People

            james.wahlin@mongodb.com James Wahlin
            anasser Ahmed Nasser
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: