Closed
Description
var UserSchema = mongoose.Schema({
firstName: {type: String, index: true}
},{autoIndex : true, collation: { locale: 'en' }});
db.user.getIndexes();
{
"v" : 2,
"key" : {
"firstName" : 1
},
"name" : "firstName_1",
"ns" : "db.user",
"background" : true
},
There is no en
collation on the index created by autoIndex . I may write a startup script to perform the autoIndex function with the collation options set on the Schema. Mongoose ignores the Schema collation when autoIndex creates an index (uses collection default collation instead).
Seems related to this other issue: #7621