Files
mongo/jstests/core/objid1.js
Siyuan Zhou 3660343e0b SERVER-12127 migrate js tests to jscore suite when not related to writes
Migrate js tests starting from j-z.
Include SERVER-12920 Update use_power_of_2.js

Signed-off-by: Matt Kangas <matt.kangas@mongodb.com>
2014-03-03 22:54:10 -05:00

17 lines
338 B
JavaScript

t = db.objid1;
t.drop();
b = new ObjectId();
assert( b.str , "A" );
a = new ObjectId( b.str );
assert.eq( a.str , b.str , "B" );
t.save( { a : a } )
assert( t.findOne().a.isObjectId , "C" );
assert.eq( a.str , t.findOne().a.str , "D" );
x = { a : new ObjectId() };
eval( " y = " + tojson( x ) );
assert.eq( x.a.str , y.a.str , "E" );