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

12 lines
268 B
JavaScript
Raw Normal View History

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} );
2009-02-04 16:58:55 +01:00
assert.eq( a._id.str, b._id.str );
c = f.update( {z:2}, {z:"abcdefgabcdefgabcdefg"} );
c = f.findOne( {} );
2009-02-04 16:58:55 +01:00
assert.eq( a._id.str, c._id.str );