summaryrefslogtreecommitdiff
path: root/jstests/core/write/update/updatej.js
blob: bab2a32f45fc21056cc148e6bc8ea33876d69141 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Test that update validation failure terminates the update without modifying subsequent
// documents.  SERVER-4779
// This test uses a multi-update, which is not retryable. The behavior it is testing is also not
// true of sharded clusters, since one shard may continue applying updates while the other
// encounters an error.
// @tags: [requires_multi_updates, requires_non_retryable_writes, assumes_unsharded_collection]

t = db.jstests_updatej;
t.drop();

t.save({a: []});
t.save({a: 1});
t.save({a: []});

assert.writeError(t.update({}, {$push: {a: 2}}, false, true));
assert.eq(1, t.count({a: 2}));