summaryrefslogtreecommitdiff
path: root/jstests/update_multi3.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/update_multi3.js')
-rw-r--r--jstests/update_multi3.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/jstests/update_multi3.js b/jstests/update_multi3.js
new file mode 100644
index 00000000000..903d8265b63
--- /dev/null
+++ b/jstests/update_multi3.js
@@ -0,0 +1,25 @@
+
+t = db.update_multi3;
+
+function test( useIndex ){
+ t.drop();
+
+ if ( useIndex )
+ t.ensureIndex({k:1})
+
+ for (i=0; i<10; i++) {
+ t.save({ _id : i , k: 'x', a: []});
+ }
+
+ t.update({k: 'x'}, {$push: {a: 'y'}}, false, true);
+
+ t.find( { k : "x" } ).forEach(
+ function(z){
+ assert.eq( [ "y" ] , z.a , "useIndex: " + useIndex )
+ }
+ );
+
+}
+
+test( false )
+test( true )