Details
-
Improvement
-
Resolution: Done
-
Critical - P2
-
mongodb-2.6, mongodb-3.0
Description
TL;TR:
We need to clarify how to delete Full Text indexes, and user must use the proper key:
db.collection.dropIndex(
)
Details
The db.collection.dropIndex(<idx>) use the key of the index as parameter. For most of the index the "key" is the value you pass when you create the index.
This is not the case for a Full Text index.
Let's take an example:
— standard index -----
db.collection.ensureIndex(
);
user can simply do:
db.collection.dropIndex(
);
>> OK
– full text search index –
db.collection.ensureIndex(
);
if the user execute :
db.collection.dropIndex(
);
the following error is raised:
"can't find index with key:
"
This is because the key is not
{ description : "text"} as you can look using the command:
db.collection.getIndexes( );
The key of the index is:
{ "_fts" : "text", "_ftsx" : 1 }The proper command is:
db.collection.dropIndex(
)