summaryrefslogtreecommitdiff
path: root/jstests/core/orb.js
blob: 345ac92d26e0a2d478e6c9658c1e2cd099f2bece (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.ensureIndex({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.ensureIndex({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 } } ] } )");