jstests/core/profile2.js
/**
 * Asserts that array 'results' contains a profiler generated document that corresponds to a
 * truncated command that matches a regular expression 'truncatedCommandRegexp'. Outputs a message
 * 'message' in case such document is not present.
 */
Asserts that array 'results' contains a profiler generated document that corresponds to a
truncated command that matches a regular expression 'truncatedCommandRegexp'. Outputs a message
'message' in case such document is not present.
Asserts that array ' results ' contains a profiler generated document that corresponds to a truncated command that matches a regular expression ' truncatedCommandRegexp ' . Outputs a message ' message ' in case such document is not present .
function assertContainsTruncatedCommand(results, truncatedCommandRegexp, message) {
    const document = results.find(
        element => element.hasOwnProperty('ns') && element.hasOwnProperty('millis') &&
            element.hasOwnProperty('command') && 'string' === typeof (element.command.$truncated) &&
            element.command.$truncated.match(truncatedCommandRegexp));
    assert(document, message + ` Retrieved documents: ${tojson(results)}`);
}
function assertContainsTruncatedCommand ( results , truncatedCommandRegexp , message ) { const document = results . find ( element => element . hasOwnProperty ( 'ns' ) && element . hasOwnProperty ( 'millis' ) && element . hasOwnProperty ( 'command' ) && 'string' === typeof ( element . command . $truncated ) && element . command . $truncated . match ( truncatedCommandRegexp ) ) ; assert ( document , message + ` ${ tojson ( results ) } ` ) ; }
Asserts that array 'results' contains a profiler generated document that corresponds to a
 truncated command that matches a regular expression 'truncatedCommandRegexp'.
Asserts that array ' results ' contains a profiler generated document that corresponds to a truncated command that matches a regular expression ' truncatedCommandRegexp ' .