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

new test for dbrefs

This commit is contained in:
dwight 2009-07-05 11:51:33 -04:00
parent 4d0a31a60d
commit 536f47c30b

21
jstests/ref.js Normal file
View File

@ -0,0 +1,21 @@
// to run:
// ./mongo jstests/ref.js
db.otherthings.drop();
db.things.drop();
var other = { s : "other thing", n : 1};
db.otherthings.save(other);
db.things.save( { name : "abc" } );
x = db.things.findOne();
x.o = other;
db.things.save(x);
assert( db.things.findOne().o.n == 1, "dbref broken 2" );
other.n++;
db.otherthings.save(other);
//print( tojson( db.things.findOne() ) );
print("ref.js: needs line uncommented after fixing bug:");
//assert( db.things.findOne().o.n == 2, "dbrefs broken" );