vertx/src/main/java/eu/internetofus/common/vertx/QueryBuilder.java
/**
   * Add a the restrictions to mark the field exist, thus that it is defined and
   * not {@code null}.
   *
   * @param fieldName  name of the field.
   * @param hasToExist is {@code true} is the field has to exist, {@code false} if
   *                   has to no exist, or {@code null} to ignore this
   *                   restriction.
   *
   * @return the factory that is using.
   */
Add a the restrictions to mark the field exist, thus that it is defined and
not  null.

@param fieldName  name of the field.
@param hasToExist is  true is the field has to exist,  false if
has to no exist, or  null to ignore this
restriction.

@return the factory that is using.
Add a the restrictions to mark the field exist thus that it is defined and not null . @param fieldName name of the field . @param hasToExist is true is the field has to exist false if has to no exist or null to ignore this restriction . @return the factory that is using .
public QueryBuilder withExist(final String fieldName, final Boolean hasToExist) {
    if (hasToExist != null) {
      if (hasToExist) {
        final var restriction = new JsonObject();
        restriction.put("$exists", true);
        restriction.putNull("$ne");
        this.query.put(fieldName, restriction);
      } else {
        this.query.putNull(fieldName);
      }
    }
    return this;
  }
public QueryBuilder withExist ( final String fieldName , final Boolean hasToExist ) { if ( hasToExist != null ) { if ( hasToExist ) { final var restriction = new JsonObject ( ) ; restriction . put ( "$exists" , true ) ; restriction . putNull ( "$ne" ) ; this . query . put ( fieldName , restriction ) ; } else { this . query . putNull ( fieldName ) ; } } return this ; }
Add a the restrictions to mark the field exist, thus that it is defined and
 not {@code null}.
Add a the restrictions to mark the field exist thus that it is defined and not { @code null } .