diff options
Diffstat (limited to 'jstests/core/updatej.js')
-rw-r--r-- | jstests/core/updatej.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/jstests/core/updatej.js b/jstests/core/updatej.js new file mode 100644 index 00000000000..6a70a4c2d51 --- /dev/null +++ b/jstests/core/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} ) ); |