Files
mongo/jstests/core/query/skip1.js
Steve McClure 1ffbc6c2e9 SERVER-109432: Autofix JS var usage to favor let (#40637)
GitOrigin-RevId: 9674b7db36a0f3f650d39c1e3fb2ad6ff2141cfb
2025-08-28 19:21:01 +00:00

17 lines
499 B
JavaScript

// SERVER-2845 When skipping objects without loading them, they shouldn't be
// included in the nscannedObjects count.
// @tags: [
// requires_getmore,
// ]
let t = db.jstests_skip1;
// SERVER-13537: Ensure that combinations of skip and limit don't crash
// the server due to overflow.
t.drop();
for (let i = 0; i < 10; i++) {
t.save({a: i});
}
assert.eq(9, t.find().sort({a: 1}).limit(2147483647).skip(1).itcount());
assert.eq(0, t.find().sort({a: 1}).skip(2147483647).limit(1).itcount());