summaryrefslogtreecommitdiff
path: root/jstests/concurrency/fsm_workloads/update_inc_pipeline.js
blob: bb4d78d7bcd0673d987ae962e116e07a268c7e3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
'use strict';

/**
 * update_inc_pipeline.js
 *
 * This is the same workload as update_inc.js, but substitutes a $mod-style update with a
 * pipeline-style one.
 */
load('jstests/concurrency/fsm_libs/extend_workload.js');  // for extendWorkload
load('jstests/concurrency/fsm_workloads/update_inc.js');  // for $config

var $config = extendWorkload($config, function($config, $super) {
    $config.data.getUpdateArgument = function getUpdateArgument(fieldName) {
        return [{$set: {[fieldName]: {$add: ["$" + fieldName, 1]}}}];
    };

    $config.data.update_inc = "update_inc_pipeline";

    return $config;
});