jstests/noPassthrough/plan_cache_index_create.js
// Returns whether there is an active index build.
Returns whether there is an active index build.
Returns whether there is an active index build .
function indexBuildIsRunning(testDB, indexName) {
    const indexBuildFilter = {
        "command.createIndexes": collName,
        "command.indexes.0.name": indexName,
        "msg": /^Index Build/
    };
    const curOp =
        testDB.getSiblingDB("admin").aggregate([{$currentOp: {}}, {$match: indexBuildFilter}]);
    return curOp.hasNext();
}
function indexBuildIsRunning ( testDB , indexName ) { const indexBuildFilter = { "command.createIndexes" : collName , "command.indexes.0.name" : indexName , "msg" : / ^Index Build / } ; const curOp = testDB . getSiblingDB ( "admin" ) . aggregate ( [ { $currentOp : { } } , { $match : indexBuildFilter } ] ) ; return curOp . hasNext ( ) ; }
Returns whether there is an active index build.
Returns whether there is an active index build .