summaryrefslogtreecommitdiff
path: root/jstests/core/collation_with_reverse_index.js
blob: af24618734823fd24ffb1ce248a9338b35a2bf24 (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");
})();