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

explain command accepts unknown options

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.7.0
    • Component/s: Querying
    • Backwards Compatibility:
      Minor Change
    • Sprint:
      Query 2019-07-29, Query 2019-08-12, Query 2020-06-01, Query 2020-06-15

      Description

      The explain command is willing to accept unrecognized arguments:

      > db.c.drop()
      true
      > db.runCommand({explain: {find: "c"}, unknownArg: "unknown"})
      {
      	"queryPlanner" : {
                 ...
      	},
      	"serverInfo" : {
                  ...
      	},
      	"ok" : 1
      }
      

      We should consider changing it to reject unfamiliar arguments with a clear error message, returning ErrorCodes::InvalidOptions. One danger of this loose validation is that a future version of the server will introduce a new option. The fact that an older version is willing to ignore this new option, rather than failing on an option it does not understand, could complicate the upgrade procedure.

        Attachments

          Activity

            People

            Assignee:
            mindaugas.malinauskas Mindaugas Malinauskas
            Reporter:
            david.storch David Storch
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: