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

Distinct command should accept a BSON element of type null for the "query" field

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.1.7
    • Fix Version/s: 3.1.8
    • Component/s: Querying
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      with 3.1.6, start a shell:

      > db.runCommand({distinct: "bar", key: "x", query: null})
      {
              "waitedMS" : NumberLong(0),
              "values" : [ ],
              "stats" : {
                      "n" : 0,
                      "nscanned" : 0,
                      "nscannedObjects" : 0
              },
              "ok" : 1
      }
      

      with 3.1.7, start a shell:

      > db.runCommand({distinct: "bar", key: "x", query: null})
      {
              "waitedMS" : NumberLong(0),
              "ok" : 0,
              "errmsg" : "\"query\" had the wrong type. Expected Object, found NULL",
              "code" : 14
      }
      

      Show
      with 3.1.6, start a shell: > db.runCommand({distinct: "bar", key: "x", query: null}) { "waitedMS" : NumberLong(0), "values" : [ ], "stats" : { "n" : 0, "nscanned" : 0, "nscannedObjects" : 0 }, "ok" : 1 } with 3.1.7, start a shell: > db.runCommand({distinct: "bar", key: "x", query: null}) { "waitedMS" : NumberLong(0), "ok" : 0, "errmsg" : "\"query\" had the wrong type. Expected Object, found NULL", "code" : 14 }
    • Sprint:
      Quint 9 09/18/15

      Description

      The distinct command used to accept a null query parameter (up through 3.1.6), but the latest nightly (3.1.7) raises an error.

      This will be a backwards breaking change for any user/driver that was sending a null query.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: