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

Remove "stats" field from distinct command response

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.10
    • Affects Version/s: 3.0.0-rc8
    • Component/s: Diagnostics, Querying
    • Fully Compatible
    • Integration 17 (07/15/16)

      When running a distinct query, the 'stats' still return using the keys from MongoDB 2.x:

      > mongo
      MongoDB shell version: 3.0.0-rc8
      connecting to: test
      > db.runCommand({distinct: 'items', key: 'name', query: {offered: false}})
      {
              "values" : [ ],
              "stats" : {
                      "n" : 0,
                      "nscanned" : 0,
                      "nscannedObjects" : 0
              },
              "ok" : 1
      }
      

      Since the explain output has renamed those stats keys' names, perhaps the distinct query should do the same for consistency. Specifically, those keys should be nReturned, totalKeysExamined, and totalDocsExamined. Best to do that before 3.0 goes gold, as it'll be more difficult and clumsy to perform later.

            Assignee:
            james.wahlin@mongodb.com James Wahlin
            Reporter:
            jason.coombs@yougov.com Jason R. Coombs
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: