blob: 77c5f52cbcf3df7e92d1c9af8b6b6a5b509e9e92 (
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]
let 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}));
|