jstests/noPassthrough/out_merge_on_secondary_killop.js
/**
 * Finds and kills the operation on the given connection marked with the given comment.
 */
Finds and kills the operation on the given connection marked with the given comment.
Finds and kills the operation on the given connection marked with the given comment .
function findAndKillOp(conn, comment) {
    assert.soon(() => {
        const curOps =
            conn.getDB("admin")
                .aggregate([{$currentOp: {allUsers: true}}, {$match: {"command.comment": comment}}])
                .toArray();
        if (curOps.length === 0) {
            return false;
        }
        assert.eq(curOps.length, 1);
        assert.commandWorked(conn.getDB(kDBName).killOp(curOps[0].opid));
        return true;
    });
}
function findAndKillOp ( conn , comment ) { assert . soon ( ( ) => { const curOps = conn . getDB ( "admin" ) . aggregate ( [ { $currentOp : { allUsers : true } } , { $match : { "command.comment" : comment } } ] ) . toArray ( ) ; if ( curOps . length === 0 ) { return false ; } assert . eq ( curOps . length , 1 ) ; assert . commandWorked ( conn . getDB ( kDBName ) . killOp ( curOps [ 0 ] . opid ) ) ; return true ; } ) ; }
Finds and kills the operation on the given connection marked with the given comment.
Finds and kills the operation on the given connection marked with the given comment .