27 IndexNotFound: Index not found
MongoDBWhat does it mean?
The referenced index was not found on the collection. Usually appears when trying to drop or rename a nonexistent index.
Why does it happen?
Giving a wrong index name or wrong key specification in a command such as dropIndex/hideIndex; the index having been dropped earlier; or the auto-generated index name differing from what was expected (MongoDB generates names like field_1_field2_-1).
How to fix it
List existing indexes and their exact names: db.my_collection.getIndexes(). Repeat the operation with the correct name or key document: db.my_collection.dropIndex({field: 1}) or db.my_collection.dropIndex('field_1'). Write drop scripts so they do not fail when the index is absent (with an existence check).
More from this engine
- 11601 InterruptedOperation was interrupted
- 85 IndexOptionsConflictIndex already exists with different options / different name
- 67 CannotCreateIndexCannot create index
- 79 UnknownReplWriteConcernUnknown replica set write concern
- 10107 NotWritablePrimarynot master / not writable primary
- 91 ShutdownInProgressThe server is in the process of shutting down
- 189 PrimarySteppedDownPrimary stepped down while operation was in progress