Files
mongo/jstests/core/update_multi3.js
Siyuan Zhou 3660343e0b SERVER-12127 migrate js tests to jscore suite when not related to writes
Migrate js tests starting from j-z.
Include SERVER-12920 Update use_power_of_2.js

Signed-off-by: Matt Kangas <matt.kangas@mongodb.com>
2014-03-03 22:54:10 -05:00

26 lines
431 B
JavaScript

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 )