2020-08-13 19:13:40 -04:00
|
|
|
// @tags: [
|
|
|
|
|
// requires_fastcount,
|
|
|
|
|
// requires_non_retryable_writes,
|
|
|
|
|
// ]
|
2009-01-26 23:28:26 -05:00
|
|
|
|
2016-03-09 12:17:50 -05:00
|
|
|
t = db.getCollection("basic2");
|
2009-01-26 23:28:26 -05:00
|
|
|
t.drop();
|
|
|
|
|
|
2016-03-09 12:17:50 -05:00
|
|
|
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);
|