An example:
A create command for clustered collections has the following format:
{ create: <coll name> clusteredIndex: { key: <doc> unique: <bool> } }
If I try to create a clustered collection but I forget the unique field I get this error message, which is misleading:
> db.runCommand({create: 'cc', clusteredIndex: {key: {_id: 1}}}) { "ok" : 0, "errmsg" : "BSON field 'create.unique' is missing but a required field", "code" : 40414, "codeName" : "IDLFailedToParse", ... }
The field clusteredIndex.unique is missing, not create.unique.
- is duplicated by
-
SERVER-89019 Wrong error given when `create` is missing from a clusteredIndex.
- Closed