diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2016-05-28 17:55:12 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2016-05-28 17:55:12 -0400 |
commit | 6dcdd23dd37ef12c87e71cf59ef01cd82432efe0 (patch) | |
tree | c8cfb5acb62c80f375bc37e7d4350382deea6a37 /jstests/concurrency/fsm_workloads/update_multifield_multiupdate.js | |
parent | d4ac5673ea3f6cef4ce9dbcec90e31813997a528 (diff) | |
download | mongo-6dcdd23dd37ef12c87e71cf59ef01cd82432efe0.tar.gz |
SERVER-23971 Clang-Format code
Diffstat (limited to 'jstests/concurrency/fsm_workloads/update_multifield_multiupdate.js')
-rw-r--r-- | jstests/concurrency/fsm_workloads/update_multifield_multiupdate.js | 72 |
1 files changed, 35 insertions, 37 deletions
diff --git a/jstests/concurrency/fsm_workloads/update_multifield_multiupdate.js b/jstests/concurrency/fsm_workloads/update_multifield_multiupdate.js index 2cc975085ca..2ca02e2f38e 100644 --- a/jstests/concurrency/fsm_workloads/update_multifield_multiupdate.js +++ b/jstests/concurrency/fsm_workloads/update_multifield_multiupdate.js @@ -12,40 +12,38 @@ load('jstests/concurrency/fsm_workloads/update_multifield.js'); // for $config // For isMongod and recordIdCanChangeOnUpdate. load('jstests/concurrency/fsm_workload_helpers/server_types.js'); -var $config = - extendWorkload($config, - function($config, $super) { - - $config.data.multi = true; - - $config.data.assertResult = function(res, db, collName, query) { - assertAlways.eq(0, res.nUpserted, tojson(res)); - - if (isMongod(db)) { - if (!recordIdCanChangeOnUpdate(db)) { - // If a document's RecordId cannot change, then we should not - // have updated any document more than once, since the update - // stage internally de-duplicates based on RecordId. - assertWhenOwnColl.lte(this.numDocs, res.nMatched, tojson(res)); - } else { - // If RecordIds can change, then there are no guarantees on how - // many documents were updated. - assertAlways.gte(res.nMatched, 0, tojson(res)); - } - } else { // mongos - assertAlways.gte(res.nMatched, 0, tojson(res)); - } - - if (db.getMongo().writeMode() === 'commands') { - assertWhenOwnColl.eq(res.nMatched, res.nModified, tojson(res)); - } - - var docs = db[collName].find().toArray(); - docs.forEach(function(doc) { - assertWhenOwnColl.eq('number', typeof doc.z); - assertWhenOwnColl.gt(doc.z, 0); - }); - }; - - return $config; - }); +var $config = extendWorkload($config, function($config, $super) { + + $config.data.multi = true; + + $config.data.assertResult = function(res, db, collName, query) { + assertAlways.eq(0, res.nUpserted, tojson(res)); + + if (isMongod(db)) { + if (!recordIdCanChangeOnUpdate(db)) { + // If a document's RecordId cannot change, then we should not + // have updated any document more than once, since the update + // stage internally de-duplicates based on RecordId. + assertWhenOwnColl.lte(this.numDocs, res.nMatched, tojson(res)); + } else { + // If RecordIds can change, then there are no guarantees on how + // many documents were updated. + assertAlways.gte(res.nMatched, 0, tojson(res)); + } + } else { // mongos + assertAlways.gte(res.nMatched, 0, tojson(res)); + } + + if (db.getMongo().writeMode() === 'commands') { + assertWhenOwnColl.eq(res.nMatched, res.nModified, tojson(res)); + } + + var docs = db[collName].find().toArray(); + docs.forEach(function(doc) { + assertWhenOwnColl.eq('number', typeof doc.z); + assertWhenOwnColl.gt(doc.z, 0); + }); + }; + + return $config; +}); |