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

Cannot get query plan or status for distinct() routed through mongos

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 2.2.3, 2.4.1
    • Fix Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      Issue a distinct command using runCommand. Observe the output does not have a query plan nor status.

      Show
      Issue a distinct command using runCommand. Observe the output does not have a query plan nor status.

      Description

      I am unable to find any way to get the query plan and stats for a distinct query in mongo shell. explain() is not valid to chain onto distinct(). The 2.2 documentation says (http://docs.mongodb.org/v2.2/reference/command/distinct/) says that "the command returns a document that contains an array of the distinct values as well as the query plan and status."

      mongos> db.actions.distinct("a",

      {...}).explain()
      Mon Mar 25 14:24:35 TypeError: db.actions.distinct("a", {...}

      ).explain is not a function (shell):1

      mongos> db.runCommand({distinct:'actions', key:"a", query:{...}})

      { "values" : [ "love" ], "ok" : 1 }

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: