Files
mongo/jstests/core/eval8.js
Randolph Tan 5595b94560 SERVER-12127 migrate js tests to jscore suite when not related to writes
Moved test jstest/[a-i].js -> jstests/core/ and made changes to comply with write command api
2014-02-28 16:26:33 -05:00

20 lines
292 B
JavaScript

t = db.eval8;
t.drop();
x = { a : 1 , b : 2 };
t.save( x );
x = t.findOne();
assert( x.a && x.b , "A" );
delete x.b;
assert( x.a && ! x.b , "B" )
x.b = 3;
assert( x.a && x.b , "C" );
assert.eq( 3 , x.b , "D" );
t.save( x );
y = t.findOne();
assert.eq( tojson( x ) , tojson( y ) , "E" );