summaryrefslogtreecommitdiff
path: root/jstests/core/query/or/orb.js
blob: 1c4a65ad9125614dae3fc67ec8fd57b2360a0eba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// check neg direction index and negation

var t = db.jstests_orb;
t.drop();

t.save({a: 1});
t.createIndex({a: -1});

assert.eq.automsg("1", "t.count( {$or: [ { a: { $gt:0,$lt:2 } }, { a: { $gt:-1,$lt:3 } } ] } )");

t.drop();

t.save({a: 1, b: 1});
t.createIndex({a: 1, b: -1});

assert.eq.automsg("1", "t.count( {$or: [ { a: { $gt:0,$lt:2 } }, { a: { $gt:-1,$lt:3 } } ] } )");
assert.eq.automsg(
    "1", "t.count( {$or: [ { a:1, b: { $gt:0,$lt:2 } }, { a:1, b: { $gt:-1,$lt:3 } } ] } )");