function matches(field, regExp) {
    if (!(Object(regExp) instanceof RegExp)) {
      regExp = new RegExp(regExp);
    }

    if (regExp.ignoreCase) {
      throw new Error('RegExp.ignoreCase flag is not supported.');
    }

    if (regExp.global) {
      throw new Error('RegExp.global flag is not supported.');
    }

    if (regExp.source.indexOf('^') != 0) {
      throw new Error('regExp must be an anchored expression, i.e. it must be started with a ^.');
    }

    var result = this._addFilter(field, '$regex', regExp.source);
    if (regExp.multiline) {
      result._addFilter(field, '$options', 'm');
    }

    return result;
  }
/**
   * Adds a regular expression filter to the field. The field value must matches the regular expression.
   * <p>Note: Only anchored expressions (Expressions that starts with an ^) and the multiline flag are supported.</p>
   * @param {string} field The field to filter
   * @param {string|RegExp} regExp The regular expression of the filter
   * @return {query.Filter<T>} The resulting Query
   * @instance
   *
   * @see http://docs.mongodb.org/manual/reference/operator/query/regex/
   */
Adds a regular expression filter to the field. The field value must matches the regular expression.
Note: Only anchored expressions (Expressions that starts with an ^) and the multiline flag are supported.
@param {string} field The field to filter
@param {string|RegExp} regExp The regular expression of the filter
@return {query.Filter} The resulting Query
@instance


Adds a regular expression filter to the field . The field value must matches the regular expression . Note : Only anchored expressions ( Expressions that starts with an ^ ) and the multiline flag are supported . @param { string } field The field to filter @param { string|RegExp } regExp The regular expression of the filter @return { query . Filter } The resulting Query @instance
function matches(field, regExp) {
    if (!(Object(regExp) instanceof RegExp)) {
      regExp = new RegExp(regExp);
    }
    if (regExp.ignoreCase) {
      throw new Error('RegExp.ignoreCase flag is not supported.');
    }
    if (regExp.global) {
      throw new Error('RegExp.global flag is not supported.');
    }
    if (regExp.source.indexOf('^') != 0) {
      throw new Error('regExp must be an anchored expression, i.e. it must be started with a ^.');
    }
    var result = this._addFilter(field, '$regex', regExp.source);
    if (regExp.multiline) {
      result._addFilter(field, '$options', 'm');
    }
    return result;
  }
function matches ( field , regExp ) { if ( ! ( Object ( regExp ) instanceof RegExp ) ) { regExp = new RegExp ( regExp ) ; } if ( regExp . ignoreCase ) { throw new Error ( 'RegExp.ignoreCase flag is not supported.' ) ; } if ( regExp . global ) { throw new Error ( 'RegExp.global flag is not supported.' ) ; } if ( regExp . source . indexOf ( '^' ) != 0 ) { throw new Error ( 'regExp must be an anchored expression, i.e. it must be started with a ^.' ) ; } var result = this . _addFilter ( field , '$regex' , regExp . source ) ; if ( regExp . multiline ) { result . _addFilter ( field , '$options' , 'm' ) ; } return result ; }
Adds a regular expression filter to the field.
Adds a regular expression filter to the field .