Invalid index options, such as specifying "sparse" as a string rather than a boolean, may have been created in the past, before the createIndexes command started validating options more strictly.
In MongoDB 5.0, the listIndexes command more strictly validates index options, and fails when an invalid option is encountered. At this point, the only option is to drop and recreate the index.
This is a variation on the problem addressed in SERVER-59805, which detects fields that are not expected in an index spec. This ticket is about index specs with known fields but unexpected value types not allowed in the IDL definition.
- is related to
-
SERVER-52545 Specify input/output to listIndexes command in IDL
- Closed
-
SERVER-65549 Fix invalid index options when upgrading to 7.0
- Closed
-
SERVER-65797 Remove invalid index specs in memory before parsing for listIndexes
- Closed
-
SERVER-59805 Provide a way to check for and to remove invalid index catalog options
- Closed