Files
mongo/jstests/core/inc3.js
Randolph Tan 5595b94560 SERVER-12127 migrate js tests to jscore suite when not related to writes
Moved test jstest/[a-i].js -> jstests/core/ and made changes to comply with write command api
2014-02-28 16:26:33 -05:00

17 lines
426 B
JavaScript

t = db.inc3;
t.drop();
t.save( { _id : 1 , z : 1 , a : 1 } );
t.update( {} , { $inc : { z : 1 , a : 1 } } );
t.update( {} , { $inc : { a : 1 , z : 1 } } );
assert.eq( { _id : 1 , z : 3 , a : 3 } , t.findOne() , "A" )
t.drop();
t.save( { _id : 1 , a : 1 , z : 1 } );
t.update( {} , { $inc : { z : 1 , a : 1 } } );
t.update( {} , { $inc : { a : 1 , z : 1 } } );
assert.eq( { _id : 1 , a : 3 , z : 3 } , t.findOne() , "B" )