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

explain command accepts unknown options

    • Minor Change
    • Query 2019-07-29, Query 2019-08-12, Query 2020-06-01, Query 2020-06-15

      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.

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

              Created:
              Updated:
              Resolved: