jstests/libs/curop_helpers.js
// Wait until the current operation matches the filter. Returns the resulting array of operations.
Wait until the current operation matches the filter. Returns the resulting array of operations.
Wait until the current operation matches the filter . Returns the resulting array of operations .
function waitForCurOpByFilter(db, filter, options = {}) {
    const adminDB = db.getSiblingDB("admin");
    let results = [];
    assert.soon(
        () => {
            results = adminDB.aggregate([{$currentOp: options}, {$match: filter}]).toArray();
            return results.length > 0;
        },
        () => {
            let allResults = adminDB.aggregate([{$currentOp: options}]).toArray();
            return "Failed to find a matching op for filter: " + tojson(filter) +
                "in currentOp output: " + tojson(allResults);
        });
    return results;
}
function waitForCurOpByFilter ( db , filter , options = { } ) { const adminDB = db . getSiblingDB ( "admin" ) ; let results = [ ] ; assert . soon ( ( ) => { results = adminDB . aggregate ( [ { $currentOp : options } , { $match : filter } ] ) . toArray ( ) ; return results . length > 0 ; } , ( ) => { let allResults = adminDB . aggregate ( [ { $currentOp : options } ] ) . toArray ( ) ; return "Failed to find a matching op for filter: " + tojson ( filter ) + "in currentOp output: " + tojson ( allResults ) ; } ) ; return results ; }
Wait until the current operation matches the filter.
Wait until the current operation matches the filter .