2020-08-13 19:13:40 -04:00
|
|
|
// @tags: [
|
|
|
|
|
// requires_fastcount,
|
|
|
|
|
// requires_non_retryable_writes,
|
2024-12-27 16:01:08 +04:00
|
|
|
// requires_getmore,
|
2020-08-13 19:13:40 -04:00
|
|
|
// ]
|
2009-01-26 23:28:26 -05:00
|
|
|
|
2016-03-09 12:17:50 -05:00
|
|
|
let t = db.getCollection("basic2");
|
2009-01-26 23:28:26 -05:00
|
|
|
t.drop();
|
|
|
|
|
|
2016-03-09 12:17:50 -05:00
|
|
|
let o = {n: 2};
|
|
|
|
|
t.save(o);
|
2009-01-26 23:28:26 -05:00
|
|
|
|
2016-03-09 12:17:50 -05:00
|
|
|
assert.eq(1, t.find().count());
|
2009-01-26 23:28:26 -05:00
|
|
|
|
2016-03-09 12:17:50 -05:00
|
|
|
assert.eq(2, t.find(o._id).toArray()[0].n);
|
|
|
|
|
assert.eq(2, t.find(o._id, {n: 1}).toArray()[0].n);
|
2009-01-26 23:28:26 -05:00
|
|
|
|
2016-03-09 12:17:50 -05:00
|
|
|
t.remove(o._id);
|
|
|
|
|
assert.eq(0, t.find().count());
|
2009-01-26 23:28:26 -05:00
|
|
|
|
|
|
|
|
assert(t.validate().valid);
|