summaryrefslogtreecommitdiff
path: root/jstests/core/ne2.js
blob: 5fef4f1d63050625b7ee24e5ac4d6dc76999005f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// check that we don't scan $ne values
// @tags: [
//   sbe_incompatible,
// ]

t = db.jstests_ne2;
t.drop();
t.createIndex({a: 1});

t.save({a: -0.5});
t.save({a: 0});
t.save({a: 0});
t.save({a: 0.5});

e = t.find({a: {$ne: 0}}).explain(true);
assert.eq(2, e.executionStats.nReturned, 'A');

e = t.find({a: {$gt: -1, $lt: 1, $ne: 0}}).explain(true);
assert.eq(2, e.executionStats.nReturned, 'B');