summaryrefslogtreecommitdiff
path: root/jstests/updatej.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/updatej.js')
-rw-r--r--jstests/updatej.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/jstests/updatej.js b/jstests/updatej.js
new file mode 100644
index 00000000000..6a70a4c2d51
--- /dev/null
+++ b/jstests/updatej.js
@@ -0,0 +1,12 @@
+// Test that update validation failure terminates the update without modifying subsequent
+// documents. SERVER-4779
+
+t = db.jstests_updatej;
+t.drop();
+
+t.save( {a:[]} );
+t.save( {a:1} );
+t.save( {a:[]} );
+
+t.update( {}, {$push:{a:2}}, false, true );
+assert.eq( 1, t.count( {a:2} ) );