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

/**
 * indexed_noindex.js
 *
 * Defines a modifier for indexed workloads that drops the index, specified by
 * $config.data.getIndexSpec(), at the end of the workload setup.
 */
function indexedNoindex($config, $super) {
    $config.setup = function(db, collName, cluster) {
        $super.setup.apply(this, arguments);

        var res = db[collName].dropIndex(this.getIndexSpec());
        assertAlways.commandWorked(res);
        this.indexExists = false;
    };

    // Remove the shard key for the no index tests
    delete $config.data.shardKey;

    return $config;
}