Class BooleanExpressions


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

      • and

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

        public static Expression not​(Expression 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 Expression or​(Expression first,
                                    Expression... additional)
        Evaluates one or more expressions and returns true if any of the expressions are true. Otherwise, $or returns false.
        Parameters:
        first - the first expression
        additional - any additional expressions
        Returns:
        the new expression
        MongoDB documentation
        Aggregration Expression: $or