Files
mongo/jstests/core/query/ne/ne2.js
Zac 591928c619 SERVER-108478 JS formatted by prettier and remove clang-format (#39656)
GitOrigin-RevId: 6c8f6aded47f260aa4f7c231b17dae3302cb1e04
2025-08-21 17:27:09 +00:00

20 lines
416 B
JavaScript

// check that we don't scan $ne values
// @tags: [
// assumes_read_concern_local,
// ]
let 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});
let 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");