Hello,
I am using atlas and I try to create a text index with french collation but I get this error. It explains that is not supported.
Is there a way to fix it ? Because the Documentation of MongoDB explains that it is possible.
Thank’s at advance,
Farouk.
db.coll.createIndex(
... {
... "name": "text",
"description" :"text"
... },
... {
... "default_language": "french"
... }
... )
{
"operationTime" : Timestamp(1633268024, 2),
"ok" : 0,
"errmsg" : "Error in specification { key: { name: \"text\" }, name: \"name_text\", default_language: \"french\", v: 2, collation: { locale: \"fr\", caseLevel: false, caseFirst: \"off\", strength: 1, numericOrdering: false, alternate: \"non-ignorable\", maxVariable: \"punct\", normalization: false, backwards: false, version: \"57.1\" } } :: caused by :: Index type 'text' does not support collation: { locale: \"fr\", caseLevel: false, caseFirst: \"off\", strength: 1, numericOrdering: false, alternate: \"non-ignorable\", maxVariable: \"punct\", normalization: false, backwards: false, version: \"57.1\" }",
"code" : 67,
"codeName" : "CannotCreateIndex",
"$clusterTime" : {
"clusterTime" : Timestamp(1633268024, 2),
"signature" : {
"hash" : BinData(0,"zpyJkmFSAFYttt42glhovt4IBZM="),
"keyId" : NumberLong("6978119209322545153")
}
}
}