Class Filters

java.lang.Object
com.codename1.backend.mongo.Filters

public final class Filters extends Object

Builds query filter documents.

Filters.and(Filters.eq("status", "open"), Filters.gte("total", 100))
  • Method Details

    • all

      public static Map all()
      Matches every document.
    • eq

      public static Map eq(String field, Object value)
      field equals value.
    • ne

      public static Map ne(String field, Object value)
      field does not equal value.
    • gt

      public static Map gt(String field, Object value)
      field is greater than value.
    • gte

      public static Map gte(String field, Object value)
      field is greater than or equal to value.
    • lt

      public static Map lt(String field, Object value)
      field is less than value.
    • lte

      public static Map lte(String field, Object value)
      field is less than or equal to value.
    • in

      public static Map in(String field, Collection values)
      field equals one of values.
    • nin

      public static Map nin(String field, Collection values)
      field equals none of values.
    • exists

      public static Map exists(String field, boolean exists)
      field is present (or absent, when exists is false).
    • regex

      public static Map regex(String field, String pattern, String options)
      field matches a regular expression, with options such as "i".
    • and

      public static Map and(Map... filters)
      Every filter holds.
    • or

      public static Map or(Map... filters)
      At least one filter holds.
    • not

      public static Map not(Map filter)
      The filter does not hold.
    • text

      public static Map text(String search)
      The collection's text index matches search.