index.js
function _matchAnyField(fields, matchAnyRegex) {
        var regExp = regExps ? matchAnyRegex ? regExps.any : regExps.all : null;
        if (regExp) {
            var orBuilder = parentBuilder.either();
            for (var i = 0; i < fields.length; ++i) {
                orBuilder = orBuilder.or().field(fields[i]).is("$regex", regExp);
            }
        }
        return parentBuilder;
    }
function _matchAnyField(fields, matchAnyRegex) {
        var regExp = regExps ? matchAnyRegex ? regExps.any : regExps.all : null;
        if (regExp) {
            var orBuilder = parentBuilder.either();
            for (var i = 0; i < fields.length; ++i) {
                orBuilder = orBuilder.or().field(fields[i]).is("$regex", regExp);
            }
        }
        return parentBuilder;
    }
function _matchAnyField ( fields , matchAnyRegex ) { var regExp = regExps ? matchAnyRegex ? regExps . any : regExps . all : null ; if ( regExp ) { var orBuilder = parentBuilder . either ( ) ; for ( var i = 0 ; i < fields . length ; ++ i ) { orBuilder = orBuilder . or ( ) . field ( fields [ i ] ) . is ( "$regex" , regExp ) ; } } return parentBuilder ; }
Matches the given Regular expression with at least one
of the fields.
@param {Array.<string>} fields Array of document fields.
@param {boolean} [matchAnyRegex=false] If true, match any
of the search query tokens, else match all.
@returns {QueryBuilder} the parent Builder.
@private
Matches the given Regular expression with at least one of the fields .