2021-07-01 14:57:37 -04:00
|
|
|
// @tags: [does_not_support_stepdowns]
|
2009-01-26 23:28:26 -05:00
|
|
|
|
2016-03-09 12:17:50 -05:00
|
|
|
t = db.getCollection("basic1");
|
2009-11-09 13:10:30 -05:00
|
|
|
t.drop();
|
2009-01-26 23:28:26 -05:00
|
|
|
|
2016-03-09 12:17:50 -05:00
|
|
|
o = {
|
|
|
|
|
a: 1
|
|
|
|
|
};
|
|
|
|
|
t.save(o);
|
2009-01-26 23:28:26 -05:00
|
|
|
|
2016-03-09 12:17:50 -05:00
|
|
|
assert.eq(1, t.findOne().a, "first");
|
|
|
|
|
assert(o._id, "now had id");
|
|
|
|
|
assert(o._id.str, "id not a real id");
|
2009-01-26 23:28:26 -05:00
|
|
|
|
|
|
|
|
o.a = 2;
|
2016-03-09 12:17:50 -05:00
|
|
|
t.save(o);
|
2009-01-26 23:28:26 -05:00
|
|
|
|
2016-03-09 12:17:50 -05:00
|
|
|
assert.eq(2, t.findOne().a, "second");
|
2009-01-26 23:28:26 -05:00
|
|
|
|
|
|
|
|
assert(t.validate().valid);
|
2009-12-22 15:22:37 -05:00
|
|
|
|
2016-03-09 12:17:50 -05:00
|
|
|
// not a very good test of currentOp, but tests that it at least
|
2009-12-22 15:22:37 -05:00
|
|
|
// is sort of there:
|
2016-03-09 12:17:50 -05:00
|
|
|
assert(db.currentOp().inprog != null);
|