summaryrefslogtreecommitdiff
path: root/jstests/concurrency/fsm_workloads/update_inc.js
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2016-03-09 12:17:50 -0500
committerJonathan Abrahams <jonathan@mongodb.com>2016-03-09 12:18:14 -0500
commit4ae691e8edc87d0e3cfb633bb91c328426be007b (patch)
tree52079a593f54382ca13a2e741633eab1b6271893 /jstests/concurrency/fsm_workloads/update_inc.js
parenta025d43f3ce2efc1fb1282a718f5d286fa0a4dc1 (diff)
downloadmongo-4ae691e8edc87d0e3cfb633bb91c328426be007b.tar.gz
SERVER-22468 Format JS code with approved style in jstests/
Diffstat (limited to 'jstests/concurrency/fsm_workloads/update_inc.js')
-rw-r--r--jstests/concurrency/fsm_workloads/update_inc.js21
1 files changed, 12 insertions, 9 deletions
diff --git a/jstests/concurrency/fsm_workloads/update_inc.js b/jstests/concurrency/fsm_workloads/update_inc.js
index adc1c536fdd..bd4c832e96f 100644
--- a/jstests/concurrency/fsm_workloads/update_inc.js
+++ b/jstests/concurrency/fsm_workloads/update_inc.js
@@ -8,7 +8,7 @@
* field. Asserts that the field has the correct value based on the number
* of increments performed.
*/
-load('jstests/concurrency/fsm_workload_helpers/server_types.js'); // for isMongod and isMMAPv1
+load('jstests/concurrency/fsm_workload_helpers/server_types.js'); // for isMongod and isMMAPv1
var $config = (function() {
@@ -25,10 +25,12 @@ var $config = (function() {
},
update: function update(db, collName) {
- var updateDoc = { $inc: {} };
+ var updateDoc = {
+ $inc: {}
+ };
updateDoc.$inc[this.fieldName] = 1;
- var res = db[collName].update({ _id: this.id }, updateDoc);
+ var res = db[collName].update({_id: this.id}, updateDoc);
assertAlways.eq(0, res.nUpserted, tojson(res));
if (isMongod(db) && !isMMAPv1(db)) {
@@ -38,8 +40,7 @@ var $config = (function() {
if (db.getMongo().writeMode() === 'commands') {
assertWhenOwnColl.eq(res.nModified, 1, tojson(res));
}
- }
- else {
+ } else {
// Zero matches are possible for MMAP v1 because the update will skip a document
// that was invalidated during a yield.
assertWhenOwnColl.contains(res.nMatched, [0, 1], tojson(res));
@@ -70,13 +71,15 @@ var $config = (function() {
};
var transitions = {
- init: { update: 1 },
- update: { find: 1 },
- find: { update: 1 }
+ init: {update: 1},
+ update: {find: 1},
+ find: {update: 1}
};
function setup(db, collName, cluster) {
- var doc = { _id: this.id };
+ var doc = {
+ _id: this.id
+ };
// Pre-populate the fields we need to avoid size change for capped collections.
for (var i = 0; i < this.threadCount; ++i) {