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 testRegexAggException(inputObj, exceptionCode) {
    assertErrorCode(coll, [{"$project": {"matches": {"$regexFindAll": inputObj}}}], exceptionCode);
    assertErrorCode(coll, [{"$project": {"matches": {"$regexFind": inputObj}}}], exceptionCode);
    assertErrorCode(coll, [{"$project": {"matches": {"$regexMatch": inputObj}}}], exceptionCode);
}
function testRegexAggException ( inputObj , exceptionCode ) { assertErrorCode ( coll , [ { "$project" : { "matches" : { "$regexFindAll" : inputObj } } } ] , exceptionCode ) ; assertErrorCode ( coll , [ { "$project" : { "matches" : { "$regexFind" : inputObj } } } ] , exceptionCode ) ; assertErrorCode ( coll , [ { "$project" : { "matches" : { "$regexMatch" : inputObj } } } ] , exceptionCode ) ; }
This function validates the output against $regexFind, $regexFindAll and $regexMatch
 expressions.
This function validates the output against $regexFind $regexFindAll and $regexMatch expressions .