summaryrefslogtreecommitdiff
path: root/jstests/update_multi5.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-06-04 15:08:53 -0400
committerEliot Horowitz <eliot@10gen.com>2010-06-04 15:08:53 -0400
commitb45d58e2adf9b5d06cb5dbfad417e5c6b9cb807f (patch)
treeb789b41afb99e7feb59583fb8edf80c05da3b8b6 /jstests/update_multi5.js
parente79e21e2e90209d9e1626ba7ddcac188a8fd4c32 (diff)
downloadmongo-b45d58e2adf9b5d06cb5dbfad417e5c6b9cb807f.tar.gz
simple multi update test
Diffstat (limited to 'jstests/update_multi5.js')
-rw-r--r--jstests/update_multi5.js17
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 );
+ }
+);
+
+