vertx/src/main/java/eu/internetofus/common/vertx/QueryBuilder.java
/**
   * Add a regular expression for a field that has an array of strings.
   *
   * @param fieldName name of the field.
   * @param patterns  patterns that the field has to match.
   *
   * @return the factory that is using.
   */
Add a regular expression for a field that has an array of strings.
@param fieldName name of the field.
@param patterns  patterns that the field has to match.

@return the factory that is using.
Add a regular expression for a field that has an array of strings . @param fieldName name of the field . @param patterns patterns that the field has to match . @return the factory that is using .
public QueryBuilder withRegex(final String fieldName, final Iterable<String> patterns) {
    if (patterns != null) {
      final var patternsMatch = new JsonArray();
      for (final String pattern : patterns) {
        patternsMatch
            .add(new JsonObject().put("$elemMatch", new JsonObject().put("$regex", pattern).put("$options", "i")));
      }
      if (patternsMatch.size() != 0) {
        this.query.put(fieldName, new JsonObject().put("$all", patternsMatch));
      }
    }
    return this;
  }
public QueryBuilder withRegex ( final String fieldName , final Iterable < String > patterns ) { if ( patterns != null ) { final var patternsMatch = new JsonArray ( ) ; for ( final String pattern : patterns ) { patternsMatch . add ( new JsonObject ( ) . put ( "$elemMatch" , new JsonObject ( ) . put ( "$regex" , pattern ) . put ( "$options" , "i" ) ) ) ; } if ( patternsMatch . size ( ) != 0 ) { this . query . put ( fieldName , new JsonObject ( ) . put ( "$all" , patternsMatch ) ) ; } } return this ; }
Add a regular expression for a field that has an array of strings.
Add a regular expression for a field that has an array of strings .