summaryrefslogtreecommitdiff
path: root/jstests/core/collation_with_reverse_index.js
blob: d586038b8b80a6e4123fa65e2c4b7a5c91028c3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// Regression test for SERVER-34846.
(function() {
const coll = db.collation_with_reverse_index;
coll.drop();

coll.insertOne({int: 1, text: "hello world"});
coll.createIndex({int: -1, text: -1}, {collation: {locale: "en", strength: 1}});
const res = coll.find({int: 1}, {_id: 0, int: 1, text: 1}).toArray();

assert.eq(res.length, 1);
assert.eq(res[0].text, "hello world");
})();