Files
mongo/jstests/core/basic1.js

25 lines
435 B
JavaScript
Raw Normal View History

// @tags: [does_not_support_stepdowns]
2009-01-26 23:28:26 -05:00
t = db.getCollection("basic1");
2009-11-09 13:10:30 -05:00
t.drop();
2009-01-26 23:28:26 -05:00
o = {
a: 1
};
t.save(o);
2009-01-26 23:28:26 -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;
t.save(o);
2009-01-26 23:28:26 -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
// 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:
assert(db.currentOp().inprog != null);