Files
mongo/jstests/core/ref3.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

20 lines
462 B
JavaScript

// to run:
// ./mongo jstests/ref3.js
db.otherthings3.drop();
db.things3.drop();
var other = { s : "other thing", n : 1};
db.otherthings3.save(other);
db.things3.save( { name : "abc" } );
x = db.things3.findOne();
x.o = new DBRef( "otherthings3" , other._id );
db.things3.save(x);
assert( db.things3.findOne().o.fetch().n == 1, "dbref broken 2" );
other.n++;
db.otherthings3.save(other);
assert( db.things3.findOne().o.fetch().n == 2, "dbrefs broken" );