Files
mongo/jstests/core/update_multi3.js
Jack Mulrow 00d92ece19 SERVER-31194 Add jscore tags for retryable_writes_jscore_stepdown_passthrough.yml suite
The actual suite will come in a follow-up commit.
2017-12-07 14:36:15 -05:00

24 lines
428 B
JavaScript

// @tags: [requires_non_retryable_writes]
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);