You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using ensureIndex() to create an index the following exception was thrown MongoCommandException with message : Caused by: com.mongodb.MongoCommandException: Command failed with error 27 (IndexNotFound): 'can't find index with key: { ... which is unexpected.
It seems that ensureIndex() calls createIndex() and, if an exception is caught, calls dropIndex() then createIndex() with the same keys.
The first call to createIndex() throws this (as my index name was too long) : Command failed with error 67 (CannotCreateIndex): 'namespace name generated from index name "<TOO_LONG_FULL_INDEX_NAME>" is too long (127 byte max)' ...
Then dropIndex() tries to drop a non-existing index and throws the IndexNotFound exception.
Propagating the CannotCreateIndex exception would make debugging easier.
The text was updated successfully, but these errors were encountered:
Using
ensureIndex()
to create an index the following exception was thrownMongoCommandException
with message :Caused by: com.mongodb.MongoCommandException: Command failed with error 27 (IndexNotFound): 'can't find index with key: { ...
which is unexpected.It seems that
ensureIndex()
callscreateIndex()
and, if an exception is caught, callsdropIndex()
thencreateIndex()
with the same keys.The first call to
createIndex()
throws this (as my index name was too long) :Command failed with error 67 (CannotCreateIndex): 'namespace name generated from index name "<TOO_LONG_FULL_INDEX_NAME>" is too long (127 byte max)' ...
Then
dropIndex()
tries to drop a non-existing index and throws theIndexNotFound
exception.Propagating the
CannotCreateIndex
exception would make debugging easier.The text was updated successfully, but these errors were encountered: