Details
Description
It appears that when covered index can be used, but collation isn't involved in match or sort then the strings from covered index query are returned without being looked up.
db.stringtest.insertOne({ int: 1, text: "hello world" });
|
db.stringtest.createIndex({ int: -1, text: -1 }, { collation: { locale: "en", strength: 1 }});
|
db.stringtest.find({ int: 1 }, { _id: 0, int: 1, text: 1 })
|
// expected result { int: 1, text: "hello world" }
|
// actual result
|
{"int" : 1, "text" : "71??E\u0004UEK?/" }
|