mirror of https://github.com/mongodb/mongo
18 lines
458 B
JavaScript
18 lines
458 B
JavaScript
/**
|
|
* 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.
|
|
*/
|
|
|
|
export function indexedNoindex($config, $super) {
|
|
$config.setup = function (db, collName, cluster) {
|
|
$super.setup.apply(this, arguments);
|
|
|
|
let res = db[collName].dropIndex(this.getIndexSpec());
|
|
assert.commandWorked(res);
|
|
};
|
|
|
|
return $config;
|
|
}
|