2
// ./mongo jstests/ref.js
7
var other = { s : "other thing", n : 1};
8
db.otherthings.save(other);
10
db.things.save( { name : "abc" } );
11
x = db.things.findOne();
12
x.o = new DBRef( "otherthings" , other._id );
15
assert( db.things.findOne().o.fetch().n == 1, "dbref broken 2" );
18
db.otherthings.save(other);
19
assert( db.things.findOne().o.fetch().n == 2, "dbrefs broken" );