summaryrefslogtreecommitdiff
path: root/jstests/update_multi5.js
diff options
context:
space:
mode:
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 );
+ }
+);
+
+