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

14 lines
230 B
JavaScript
Raw Normal View History

2009-01-27 05:28:26 +01:00
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 );