Hi
Currently you would have to recreate the index if you want to remove the collation in the index.
If all your indexes are created with that collation, it is possible that the collection has a default collation in place. The default collation for a collection can be specified as part of the db.createCollection() command. If a collection has a default collation:
You can check if the collection has a default collation set up using the db.getCollectionInfos() command. For example:
test> db.createCollection('testcollation', {collation:{locale:'en'}})
{
"ok": 1
}
test> db.getCollectionInfos({name:'testcollation'})
[
{
"name": "testcollation",
"type": "collection",
"options": {
"collation": {
"locale": "en",
"caseLevel": false,
"caseFirst": "off",
"strength": 3,
"numericOrdering": false,
"alternate": "non-ignorable",
"maxVariable": "punct",
"normalization": false,
"backwards": false,
"version": "57.1"
}
},
"info": {
"readOnly": false
},
"idIndex": {
"v": 2,
"key": {
"_id": 1
},
"name": "_id_",
"ns": "test.testcollation",
"collation": {
"locale": "en",
"caseLevel": false,
"caseFirst": "off",
"strength": 3,
"numericOrdering": false,
"alternate": "non-ignorable",
"maxVariable": "punct",
"normalization": false,
"backwards": false,
"version": "57.1"
}
}
}
]
There is currently no method to remove a collections’ default collation. If your collection has a default collation, you would need to recreate the collection.
Best regards
Kevin