diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-06-04 15:08:53 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-06-04 15:08:53 -0400 |
commit | b45d58e2adf9b5d06cb5dbfad417e5c6b9cb807f (patch) | |
tree | b789b41afb99e7feb59583fb8edf80c05da3b8b6 /jstests/update_multi5.js | |
parent | e79e21e2e90209d9e1626ba7ddcac188a8fd4c32 (diff) | |
download | mongo-b45d58e2adf9b5d06cb5dbfad417e5c6b9cb807f.tar.gz |
simple multi update test
Diffstat (limited to 'jstests/update_multi5.js')
-rw-r--r-- | jstests/update_multi5.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/jstests/update_multi5.js b/jstests/update_multi5.js new file mode 100644 index 00000000000..46ef8f36da5 --- /dev/null +++ b/jstests/update_multi5.js @@ -0,0 +1,17 @@ + +t = db.update_multi5; + +t.drop() + +t.insert({path: 'r1', subscribers: [1,2]}); +t.insert({path: 'r2', subscribers: [3,4]}); + +t.update({}, {$addToSet: {subscribers: 5}}, false, true); + +t.find().forEach( + function(z){ + assert.eq( 3 , z.subscribers.length , z ); + } +); + + |