Files
mongo/jstests/core/query/query1.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

29 lines
558 B
JavaScript

// @tags: [
// requires_fastcount,
// requires_getmore,
// ]
let t = db.query1;
t.drop();
t.save({num: 1});
t.save({num: 3});
t.save({num: 4});
let num = 0;
let total = 0;
t.find().forEach(function (z) {
num++;
total += z.num;
});
assert.eq(num, 3, "num");
assert.eq(total, 8, "total");
assert.eq(3, t.find().comment("this is a test").itcount(), "B1");
assert.eq(3, t.find().comment("this is a test").count(), "B2");
assert.eq(3, t.find().comment("yo ho ho").itcount(), "C1");
assert.eq(3, t.find().comment("this is a test").count(), "C2");