diff options
Diffstat (limited to 'jstests/concurrency/fsm_workloads/findAndModify_update.js')
-rw-r--r-- | jstests/concurrency/fsm_workloads/findAndModify_update.js | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/jstests/concurrency/fsm_workloads/findAndModify_update.js b/jstests/concurrency/fsm_workloads/findAndModify_update.js index 8d6c8b9b2c7..c794c755ed9 100644 --- a/jstests/concurrency/fsm_workloads/findAndModify_update.js +++ b/jstests/concurrency/fsm_workloads/findAndModify_update.js @@ -11,14 +11,18 @@ var $config = (function() { var data = { - numDocsPerThread: 3, // >1 for 'sort' to be meaningful - shardKey: { tid: 1 } + numDocsPerThread: 3, // >1 for 'sort' to be meaningful + shardKey: {tid: 1} }; var states = (function() { function makeDoc(tid) { - return { _id: new ObjectId(), tid: tid, value: 0 }; + return { + _id: new ObjectId(), + tid: tid, + value: 0 + }; } function init(db, collName) { @@ -34,10 +38,9 @@ var $config = (function() { var res = db.runCommand({ findandmodify: db[collName].getName(), - query: { tid: this.tid }, - sort: { value: 1 }, - update: { $max: { value: updatedValue } }, - new: true + query: {tid: this.tid}, + sort: {value: 1}, + update: {$max: {value: updatedValue}}, new: true }); assertAlways.commandWorked(res); @@ -55,10 +58,9 @@ var $config = (function() { var res = db.runCommand({ findandmodify: db[collName].getName(), - query: { tid: this.tid }, - sort: { value: -1 }, - update: { $min: { value: updatedValue } }, - new: true + query: {tid: this.tid}, + sort: {value: -1}, + update: {$min: {value: updatedValue}}, new: true }); assertAlways.commandWorked(res); @@ -80,13 +82,13 @@ var $config = (function() { })(); var transitions = { - init: { findAndModifyAscending: 0.5, findAndModifyDescending: 0.5 }, - findAndModifyAscending: { findAndModifyAscending: 0.5, findAndModifyDescending: 0.5 }, - findAndModifyDescending: { findAndModifyAscending: 0.5, findAndModifyDescending: 0.5 } + init: {findAndModifyAscending: 0.5, findAndModifyDescending: 0.5}, + findAndModifyAscending: {findAndModifyAscending: 0.5, findAndModifyDescending: 0.5}, + findAndModifyDescending: {findAndModifyAscending: 0.5, findAndModifyDescending: 0.5} }; function setup(db, collName, cluster) { - var res = db[collName].ensureIndex({ tid: 1, value: 1 }); + var res = db[collName].ensureIndex({tid: 1, value: 1}); assertAlways.commandWorked(res); } |