Package org.mongojack
Class DBQuery.AbstractBuilder<Q extends DBQuery.AbstractBuilder>
- java.lang.Object
-
- org.mongojack.DBQuery.AbstractBuilder<Q>
-
- Direct Known Subclasses:
Aggregation.Match
,DBQuery.Query
- Enclosing class:
- DBQuery
public abstract static class DBQuery.AbstractBuilder<Q extends DBQuery.AbstractBuilder> extends Object
-
-
Constructor Summary
Constructors Constructor Description AbstractBuilder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Q
all(String field, Object... values)
The array field contains all of the given valuesQ
all(String field, Collection<?> values)
The array field contains all of the given valuesQ
and(DBQuery.Query... expressions)
All of the given expressions matchesQ
elemMatch(String field, DBQuery.Query query)
An element in the given array field matches the given queryQ
exists(String field)
The given field existsQ
greaterThan(String field, Object value)
The field is greater than the given valueQ
greaterThanEquals(String field, Object value)
The field is greater than or equal to the given valueQ
in(String field, Object... values)
The field is in the given set of valuesQ
in(String field, Collection<?> values)
The field is in the given set of valuesQ
is(String field, Object value)
The field is equal to the given valueQ
lessThan(String field, Object value)
The field is less than the given valueQ
lessThanEquals(String field, Object value)
The field is less than or equal to the given valueQ
mod(String field, Number mod, Number value)
The field, modulo the given mod argument, is equal to the value { field: { $mod: [ divisor, remainder ] } }Q
nor(DBQuery.Query... expressions)
None of the given expressions matchesQ
notEquals(String field, Object value)
The field is not equal to the given valueQ
notExists(String field)
The given field doesn't existQ
notIn(String field, Object... values)
The field is not in the given set of valuesQ
notIn(String field, Collection<?> values)
The field is not in the given set of valuesQ
or(DBQuery.Query... expressions)
One of the given expressions matchesprotected Q
put(String field, String op, Collection<?> values)
protected abstract Q
put(String field, String op, QueryCondition value)
protected abstract Q
put(String op, QueryCondition value)
protected abstract Q
putGroup(String op, DBQuery.Query... expressions)
Q
regex(String field, Pattern regex)
The given field matches the regular expressionQ
size(String field, int size)
The array field is of the given sizeQ
where(String code)
Execute the given JavaScript code as part of the query
-
-
-
Method Detail
-
is
public Q is(String field, Object value)
The field is equal to the given value- Parameters:
field
- The field to comparevalue
- 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 comparevalue
- 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 comparevalue
- 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 comparevalue
- 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 comparevalue
- 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 comparevalue
- 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 comparevalues
- 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 comparevalues
- 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 comparevalues
- 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 comparevalues
- 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 comparemod
- The modulovalue
- 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 comparevalues
- 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 comparevalues
- 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 comparesize
- 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 comareregex
- 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 fieldquery
- 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
-
put
protected abstract Q put(String op, QueryCondition value)
-
put
protected abstract Q put(String field, String op, QueryCondition value)
-
put
protected Q put(String field, String op, Collection<?> values)
-
putGroup
protected abstract Q putGroup(String op, DBQuery.Query... expressions)
-
-