Class BooleanExpressions


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

      • and

        public static BooleanExpressions.LogicalExpression and​(dev.morphia.aggregation.expressions.impls.Expression first,
                                                               dev.morphia.aggregation.expressions.impls.Expression... additional)
        Evaluates one or more expressions and returns true if all 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 dev.morphia.aggregation.expressions.impls.Expression not​(dev.morphia.aggregation.expressions.impls.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 BooleanExpressions.LogicalExpression or​(dev.morphia.aggregation.expressions.impls.Expression first,
                                                              dev.morphia.aggregation.expressions.impls.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