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

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

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.2.3, 2.4.1
    • Component/s: Querying
    • None
    • ALL
    • 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.

      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 }

            Assignee:
            Unassigned Unassigned
            Reporter:
            jwineinger Jay Wineinger
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: