diff options
author | Eliot Horowitz <eliot@10gen.com> | 2009-10-02 17:07:07 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2009-10-02 17:07:07 -0400 |
commit | cc2c5c491100d3c8782a1c95b6fc362db91158c5 (patch) | |
tree | dd7fa8efde833e170c387b77c82420339b0c2128 /jstests/ref3.js | |
parent | eaf0c845bccc01d61b7971b8c3b507fc7a175d38 (diff) | |
download | mongo-cc2c5c491100d3c8782a1c95b6fc362db91158c5.tar.gz |
add new style DBRef to js SERVER-243
Diffstat (limited to 'jstests/ref3.js')
-rw-r--r-- | jstests/ref3.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/jstests/ref3.js b/jstests/ref3.js new file mode 100644 index 00000000000..77d6038f182 --- /dev/null +++ b/jstests/ref3.js @@ -0,0 +1,19 @@ +// 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 = new DBRef( "otherthings" , other._id ); +db.things.save(x); + +assert( db.things.findOne().o.fetch().n == 1, "dbref broken 2" ); + +other.n++; +db.otherthings.save(other); +assert( db.things.findOne().o.fetch().n == 2, "dbrefs broken" ); |