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

Remove "stats" field from distinct command response

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.0.0-rc8
    • Fix Version/s: 3.3.10
    • Component/s: Diagnostics, Querying
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Integration 17 (07/15/16)

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: