-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.4.10, 2.6.0
-
Component/s: Text Search
-
None
-
ALL
-
ISSUE SUMMARY
Renaming a collection within same database fails if a wildcard text index is present on the collection. The rename operation produces the following error message:
{ "errmsg" : "exception: unknown operator: $**", "code" : 2, "ok" : 0 }
USER IMPACT
If a rename operation fails in this manner, the documents from the old collection will have successfully moved to the new collection. However, the new collection may be missing indexes, and operations against the old collection may crash the server. No loss of user data will occur.
WORKAROUNDS
To work around this issue, perform a two-step cross-database rename process that avoids renaming a collection within the same database.
For example, suppose the following rename of a collection within the same database is desired:
db.adminCommand({renameCollection: "database.collection1", to: "database.collection2"});
Instead, run the following two operations:
db.adminCommand({renameCollection: "database.collection1", to: "temporary_database.collection"}); db.adminCommand({renameCollection: "temporary_database.collection", to: "database.collection2"});
AFFECTED VERSIONS
All MongoDB 2.4 production releases, and MongoDB 2.6 production releases up to 2.6.3 are affected by this issue.
FIX VERSION
The fix is included in the 2.6.4 production release.
RESOLUTION DETAILS
The logic to remove the text index from the old collection is corrected.
Original description
If you have a collection with an all fields FTS index and use rename collection you get an error that says.
{ "errmsg" : "exception: unknown operator: $**", "code" : 2, "ok" : 0 }