0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 00:56:44 +01:00
mongodb/jstests/objid1.js
2009-01-31 17:22:22 -05:00

14 lines
230 B
JavaScript

t = db.objid1;
t.drop();
b = new ObjectId();
assert( b.str , "objid1 test1" );
a = ObjectId( b.str );
assert.eq( a.str , b.str );
t.save( { a : a } )
assert( t.findOne().a.isObjectId );
assert.eq( a.str , t.findOne().a.str );