0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/jstests/basic1.js

22 lines
416 B
JavaScript
Raw Normal View History

2009-01-27 05:28:26 +01:00
t = db.getCollection( "basic1" );
2009-11-09 19:10:30 +01:00
t.drop();
2009-01-27 05:28:26 +01:00
o = { a : 1 };
t.save( o );
assert.eq( 1 , t.findOne().a , "first" );
assert( o._id , "now had id" );
assert( o._id.str , "id not a real id" );
o.a = 2;
t.save( o );
assert.eq( 2 , t.findOne().a , "second" );
assert(t.validate().valid);
2009-12-22 21:22:37 +01:00
// not a very good test of currentOp, but tests that it at least
// is sort of there:
assert( db.currentOp().inprog != null );