diff options
Diffstat (limited to 'jstests/core/update3.js')
-rw-r--r-- | jstests/core/update3.js | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/jstests/core/update3.js b/jstests/core/update3.js index d29d073a40a..79562fe72d0 100644 --- a/jstests/core/update3.js +++ b/jstests/core/update3.js @@ -3,26 +3,26 @@ f = db.jstests_update3; f.drop(); -f.save( { a:1 } ); -f.update( {}, {$inc:{ a:1 }} ); -assert.eq( 2, f.findOne().a , "A" ); +f.save({a: 1}); +f.update({}, {$inc: {a: 1}}); +assert.eq(2, f.findOne().a, "A"); f.drop(); -f.save( { a:{ b: 1 } } ); -f.update( {}, {$inc:{ "a.b":1 }} ); -assert.eq( 2, f.findOne().a.b , "B" ); +f.save({a: {b: 1}}); +f.update({}, {$inc: {"a.b": 1}}); +assert.eq(2, f.findOne().a.b, "B"); f.drop(); -f.save( { a:{ b: 1 } } ); -f.update( {}, {$set:{ "a.b":5 }} ); -assert.eq( 5, f.findOne().a.b , "C" ); +f.save({a: {b: 1}}); +f.update({}, {$set: {"a.b": 5}}); +assert.eq(5, f.findOne().a.b, "C"); f.drop(); -f.save( {'_id':0} ); -f.update( {}, {$set:{'_id':5}} ); -assert.eq( 0, f.findOne()._id , "D" ); +f.save({'_id': 0}); +f.update({}, {$set: {'_id': 5}}); +assert.eq(0, f.findOne()._id, "D"); f.drop(); -f.save({_id:1, a:1}); -f.update({}, {$unset:{"a":1, "b.c":1}}); -assert.docEq(f.findOne(), {_id:1}, "E");
\ No newline at end of file +f.save({_id: 1, a: 1}); +f.update({}, {$unset: {"a": 1, "b.c": 1}}); +assert.docEq(f.findOne(), {_id: 1}, "E");
\ No newline at end of file |