public class Criteria extends Object
| Modifier and Type | Method and Description |
|---|---|
Criteria |
all(Collection<?> c)
The
all operator is similar to $in, but instead of matching any value in the specified array all values in the array must be matched. |
Criteria |
all(Object... o)
The
all operator is similar to $in, but instead of matching any value in the specified array all values in the array must be matched. |
Criteria |
and(String key)
Static factory method to create a Criteria using the provided key
|
Criteria |
andOperator(Criteria... criteria)
Creates an 'and' criteria using the $and operator for all of the provided criteria
|
Criteria |
eq(Object o)
Creates a criterion using equality
|
Criteria |
exists(boolean b)
Check for existence (or lack thereof) of a field.
|
Criteria |
gt(Object o)
Creates a criterion using the > operator
|
Criteria |
gte(Object o)
Creates a criterion using the >= operator
|
Criteria |
in(Collection<?> c)
The
in operator is analogous to the SQL IN modifier, allowing you
to specify an array of possible matches. |
Criteria |
in(Object... o)
The
in operator is analogous to the SQL IN modifier, allowing you
to specify an array of possible matches. |
Criteria |
is(Object o)
Creates a criterion using equality
|
Criteria |
lt(Object o)
Creates a criterion using the < operator
|
Criteria |
lte(Object o)
Creates a criterion using the <= operator
|
Criteria |
ne(Object o)
Creates a criterion using the != operator
|
Criteria |
nin(Collection<?> c)
The
nin operator is similar to $in except that it selects objects for
which the specified field does not have any value in the specified array. |
Criteria |
nin(Object... o)
The
nin operator is similar to $in except that it selects objects for
which the specified field does not have any value in the specified array. |
Criteria |
notEmpty()
The
notEmpty operator checks that an array is not empty. |
Criteria |
regex(Pattern pattern)
Creates a criterion using a Regex
|
Criteria |
size(int s)
The
size operator matches any array with the specified number of elements. |
Criteria |
type(Class<?> t)
The $type operator matches values based on their Java type.
|
static Criteria |
where(String key)
Static factory method to create a Criteria using the provided key
|
public static Criteria where(String key)
key - filed namepublic Criteria and(String key)
key - ads new filed to criteriapublic Criteria in(Object... o)
in operator is analogous to the SQL IN modifier, allowing you
to specify an array of possible matches.o - the values to match againstpublic Criteria in(Collection<?> c)
in operator is analogous to the SQL IN modifier, allowing you
to specify an array of possible matches.c - the collection containing the values to match againstpublic Criteria nin(Object... o)
nin operator is similar to $in except that it selects objects for
which the specified field does not have any value in the specified array.o - the values to match againstpublic Criteria nin(Collection<?> c)
nin operator is similar to $in except that it selects objects for
which the specified field does not have any value in the specified array.c - the values to match againstpublic Criteria all(Object... o)
all operator is similar to $in, but instead of matching any value in the specified array all values in the array must be matched.o - public Criteria all(Collection<?> c)
all operator is similar to $in, but instead of matching any value in the specified array all values in the array must be matched.c - public Criteria size(int s)
size operator matches any array with the specified number of elements.s - public Criteria notEmpty()
notEmpty operator checks that an array is not empty.public Criteria exists(boolean b)
b - public Criteria type(Class<?> t)
t - public Criteria regex(Pattern pattern)
pattern - Copyright © 2011–2013. All rights reserved.