Files
mongo/jstests/core/autoid.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

12 lines
268 B
JavaScript

f = db.jstests_autoid;
f.drop();
f.save( {z:1} );
a = f.findOne( {z:1} );
f.update( {z:1}, {z:2} );
b = f.findOne( {z:2} );
assert.eq( a._id.str, b._id.str );
c = f.update( {z:2}, {z:"abcdefgabcdefgabcdefg"} );
c = f.findOne( {} );
assert.eq( a._id.str, c._id.str );