Class BooleanExpressions

java.lang.Object
dev.morphia.aggregation.expressions.BooleanExpressions

public final class BooleanExpressions extends Object
Defines helper methods for the boolean expressions
Since:
2.0
  • Method Details

    • and

      public static LogicalExpression and(Object first, Object... additional)
      Evaluates one or more values and returns true if all the values are true or if evoked with no argument expressions. Otherwise, $and returns false.
      Parameters:
      first - the first value
      additional - any additional values
      Returns:
      the new expression
      MongoDB documentation
      Aggregration Expression: $and
    • and

      public static LogicalExpression and()
      Evaluates one or more values and returns true if all the values are true or if evoked with no argument expressions. Otherwise, $and returns false.
      Returns:
      the new expression
      Since:
      2.3
      MongoDB documentation
      Aggregration Expression: $and
    • not

      public static Expression not(Object value)
      Evaluates a boolean and returns the opposite boolean value; i.e. when passed an expression that evaluates to true, $not returns false; when passed an expression that evaluates to false, $not returns true.
      Parameters:
      value - the expression
      Returns:
      the new expression
      MongoDB documentation
      Aggregration Expression: $not
    • or

      public static LogicalExpression or(Object first, Object... additional)
      Evaluates one or more values and returns true if any of the values are true. Otherwise, $or returns false.
      Parameters:
      first - the first value
      additional - any additional values
      Returns:
      the new expression
      MongoDB documentation
      Aggregration Expression: $or
    • or

      public static LogicalExpression or()
      Evaluates one or more values and returns true if any of the values are true. Otherwise, $or returns false.
      Returns:
      the new expression
      Since:
      2.3
      MongoDB documentation
      Aggregration Expression: $or