Package org.mongojack

Class DBQuery.AbstractBuilder<Q extends DBQuery.AbstractBuilder>

    • Constructor Detail

      • AbstractBuilder

        public AbstractBuilder()
    • Method Detail

      • is

        public Q is​(String field,
                    Object value)
        The field is equal to the given value
        Parameters:
        field - The field to compare
        value - The value to compare to
        Returns:
        the query
      • lessThan

        public Q lessThan​(String field,
                          Object value)
        The field is less than the given value
        Parameters:
        field - The field to compare
        value - The value to compare to
        Returns:
        the query
      • lessThanEquals

        public Q lessThanEquals​(String field,
                                Object value)
        The field is less than or equal to the given value
        Parameters:
        field - The field to compare
        value - The value to compare to
        Returns:
        the query
      • greaterThan

        public Q greaterThan​(String field,
                             Object value)
        The field is greater than the given value
        Parameters:
        field - The field to compare
        value - The value to compare to
        Returns:
        the query
      • greaterThanEquals

        public Q greaterThanEquals​(String field,
                                   Object value)
        The field is greater than or equal to the given value
        Parameters:
        field - The field to compare
        value - The value to compare to
        Returns:
        the query
      • notEquals

        public Q notEquals​(String field,
                           Object value)
        The field is not equal to the given value
        Parameters:
        field - The field to compare
        value - The value to compare to
        Returns:
        the query
      • in

        public Q in​(String field,
                    Object... values)
        The field is in the given set of values
        Parameters:
        field - The field to compare
        values - The value to compare to
        Returns:
        the query
      • in

        public Q in​(String field,
                    Collection<?> values)
        The field is in the given set of values
        Parameters:
        field - The field to compare
        values - The value to compare to
        Returns:
        the query
      • notIn

        public Q notIn​(String field,
                       Object... values)
        The field is not in the given set of values
        Parameters:
        field - The field to compare
        values - The value to compare to
        Returns:
        the query
      • notIn

        public Q notIn​(String field,
                       Collection<?> values)
        The field is not in the given set of values
        Parameters:
        field - The field to compare
        values - The value to compare to
        Returns:
        the query
      • mod

        public Q mod​(String field,
                     Number mod,
                     Number value)
        The field, modulo the given mod argument, is equal to the value { field: { $mod: [ divisor, remainder ] } }
        Parameters:
        field - The field to compare
        mod - The modulo
        value - The value to compare to
        Returns:
        the query
      • all

        public Q all​(String field,
                     Collection<?> values)
        The array field contains all of the given values
        Parameters:
        field - The field to compare
        values - The values to compare to
        Returns:
        the query
      • all

        public Q all​(String field,
                     Object... values)
        The array field contains all of the given values
        Parameters:
        field - The field to compare
        values - The values to compare to
        Returns:
        the query
      • size

        public Q size​(String field,
                      int size)
        The array field is of the given size
        Parameters:
        field - The field to compare
        size - The value to compare
        Returns:
        the query
      • exists

        public Q exists​(String field)
        The given field exists
        Parameters:
        field - The field to check
        Returns:
        the query
      • notExists

        public Q notExists​(String field)
        The given field doesn't exist
        Parameters:
        field - The field to check
        Returns:
        the query
      • or

        public Q or​(DBQuery.Query... expressions)
        One of the given expressions matches
        Parameters:
        expressions - The expressions to test
        Returns:
        the query
      • and

        public Q and​(DBQuery.Query... expressions)
        All of the given expressions matches
        Parameters:
        expressions - The expressions to test
        Returns:
        the query
      • nor

        public Q nor​(DBQuery.Query... expressions)
        None of the given expressions matches
        Parameters:
        expressions - The expressions to test
        Returns:
        the query
      • regex

        public Q regex​(String field,
                       Pattern regex)
        The given field matches the regular expression
        Parameters:
        field - The field to comare
        regex - The regular expression to match with
        Returns:
        the query
      • elemMatch

        public Q elemMatch​(String field,
                           DBQuery.Query query)
        An element in the given array field matches the given query
        Parameters:
        field - the array field
        query - The query to attempt to match against the elements of the array field
        Returns:
        the query
      • where

        public Q where​(String code)
        Execute the given JavaScript code as part of the query
        Parameters:
        code - the JavaScript code
        Returns:
        the query