Class Match

java.lang.Object
net.pincette.mongo.Match

public class Match extends Object
You can match JSON objects with MongoDB queries using this class. The following operators are not supported: $jsonSchema, $text, $where and the geospatial operators. The operator $expr should contain only expressions which yield a boolean or aggregation expressions. The operator $all doesn't work with the $elemMatch operator.

If you wrap an expression in the $trace operator then tracing will be done for it in the logger "net.pincette.mongo.expressions" at level INFO.

Since:
1.2
Author:
Werner Donné
See Also:
  • Method Details

    • logger

      public static Logger logger()
      If you set the log level to FINEST you will get a trace.
      Returns:
      The logger with the name "net.pincette.mongo.expression".
      Since:
      1.3
    • predicate

      public static Predicate<JsonObject> predicate(JsonObject expression)
      Constructs a predicate with expression.
      Parameters:
      expression - the MongoDB query.
      Returns:
      The predicate, which is stateless.
      Since:
      1.2
    • predicate

      public static Predicate<JsonObject> predicate(JsonObject expression, Features features)
      Constructs a predicate with expression.
      Parameters:
      expression - the MongoDB query.
      features - extra features. It may be null.
      Returns:
      The predicate, which is stateless.
      Since:
      2.0
    • predicate

      public static Predicate<JsonObject> predicate(Bson expression)
      Constructs a predicate with expression.
      Parameters:
      expression - the MongoDB query.
      Returns:
      The predicate, which is stateless.
      Since:
      1.2
    • predicate

      public static Predicate<JsonObject> predicate(Bson expression, Features features)
      Constructs a predicate with expression.
      Parameters:
      expression - the MongoDB query.
      features - extra features. It may be null.
      Returns:
      The predicate, which is stateless.
      Since:
      2.0
    • predicateValue

      public static Predicate<JsonValue> predicateValue(JsonObject expression, Features features)
      Constructs a predicate to test a JSON value.
      Parameters:
      expression - the MongoDB query.
      features - extra features. It may be null.
      Returns:
      The predicate, which is stateless.
      Since:
      2.0