mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 00:56:44 +01:00
14 lines
230 B
JavaScript
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 );
|
|
|