diff options
author | Jonathan Abrahams <jonathan@mongodb.com> | 2016-03-09 12:17:50 -0500 |
---|---|---|
committer | Jonathan Abrahams <jonathan@mongodb.com> | 2016-03-09 12:18:14 -0500 |
commit | 4ae691e8edc87d0e3cfb633bb91c328426be007b (patch) | |
tree | 52079a593f54382ca13a2e741633eab1b6271893 /jstests/core/updated.js | |
parent | a025d43f3ce2efc1fb1282a718f5d286fa0a4dc1 (diff) | |
download | mongo-4ae691e8edc87d0e3cfb633bb91c328426be007b.tar.gz |
SERVER-22468 Format JS code with approved style in jstests/
Diffstat (limited to 'jstests/core/updated.js')
-rw-r--r-- | jstests/core/updated.js | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/jstests/core/updated.js b/jstests/core/updated.js index da314268eb0..1eaaae3b051 100644 --- a/jstests/core/updated.js +++ b/jstests/core/updated.js @@ -2,19 +2,25 @@ t = db.updated; t.drop(); -o = { _id : Math.random() , - items:[null,null,null,null] - }; +o = { + _id: Math.random(), + items: [null, null, null, null] +}; -t.insert( o ); -assert.docEq( o , t.findOne() , "A1" ); +t.insert(o); +assert.docEq(o, t.findOne(), "A1"); -o.items[0] = {amount:9000,itemId:1}; -t.update({},{$set:{"items.0":o.items[0]}}); -assert.docEq( o , t.findOne() , "A2" ); +o.items[0] = { + amount: 9000, + itemId: 1 +}; +t.update({}, {$set: {"items.0": o.items[0]}}); +assert.docEq(o, t.findOne(), "A2"); o.items[0].amount += 1000; -o.items[1] = {amount:1,itemId:2}; -t.update({},{$inc:{"items.0.amount":1000},$set:{"items.1":o.items[1]}}); -assert.docEq( o , t.findOne() , "A3" ); - +o.items[1] = { + amount: 1, + itemId: 2 +}; +t.update({}, {$inc: {"items.0.amount": 1000}, $set: {"items.1": o.items[1]}}); +assert.docEq(o, t.findOne(), "A3"); |