jstests/noPassthrough/currentop_query.js
// generic command object and creates an appropriate filter given the use-case.
generic command object and creates an appropriate filter given the use-case.
generic command object and creates an appropriate filter given the use - case .
function commandOrOriginatingCommand(cmdObj, isRemoteShardCurOp) {
    const cmdFieldName = (isRemoteShardCurOp ? "cursor.originatingCommand" : "command");
    const cmdFilter = {};
    for (let subFieldName in cmdObj) {
        cmdFilter[`${cmdFieldName}.${subFieldName}`] = cmdObj[subFieldName];
    }
    return cmdFilter;
}
function commandOrOriginatingCommand ( cmdObj , isRemoteShardCurOp ) { const cmdFieldName = ( isRemoteShardCurOp ? "cursor.originatingCommand" : "command" ) ; const cmdFilter = { } ; for ( let subFieldName in cmdObj ) { cmdFilter [ ` ${ cmdFieldName } ${ subFieldName } ` ] = cmdObj [ subFieldName ] ; } return cmdFilter ; }
generic command object and creates an appropriate filter given the use-case.
generic command object and creates an appropriate filter given the use - case .