0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/jstests/objid1.js
2009-05-14 16:35:43 -04:00

14 lines
241 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" );