jstests/aggregation/expressions/regex.js
/**
 * This function validates the output against $regexFind, $regexFindAll and $regexMatch
 * expressions.
 */
This function validates the output against $regexFind, $regexFindAll and $regexMatch
expressions.
This function validates the output against $regexFind $regexFindAll and $regexMatch expressions .
function testRegexFindAggForKey(key, inputObj, expectedOutputForFindAll) {
    testRegexForKey("$regexFindAll", key, inputObj, expectedOutputForFindAll);
    const expectedOutputForFind =
        expectedOutputForFindAll.length == 0 ? null : expectedOutputForFindAll[0];
    testRegexForKey("$regexFind", key, inputObj, expectedOutputForFind);
    const expectedOutputForMatch = expectedOutputForFindAll.length != 0;
    testRegexForKey("$regexMatch", key, inputObj, expectedOutputForMatch);
}
function testRegexFindAggForKey ( key , inputObj , expectedOutputForFindAll ) { testRegexForKey ( "$regexFindAll" , key , inputObj , expectedOutputForFindAll ) ; const expectedOutputForFind = expectedOutputForFindAll . length == 0 ? null : expectedOutputForFindAll [ 0 ] ; testRegexForKey ( "$regexFind" , key , inputObj , expectedOutputForFind ) ; const expectedOutputForMatch = expectedOutputForFindAll . length != 0 ; testRegexForKey ( "$regexMatch" , key , inputObj , expectedOutputForMatch ) ; }
This function validates the output against $regexFind, $regexFindAll and $regexMatch
 expressions.
This function validates the output against $regexFind $regexFindAll and $regexMatch expressions .