Details
-
Task
-
Resolution: Done
-
Minor - P4
-
None
-
Minor Change
-
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
Issue Links
- links to