|
Spring Data MongoDB - Core | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.data.mongodb.core.query.Criteria
public class Criteria
Central class for creating queries. It follows a fluent API style so that you can easily chain together multiple criteria. Static import of the 'Criteria.where' method will improve readability.
| Constructor Summary | |
|---|---|
|
Criteria()
|
protected |
Criteria(List<Criteria> criteriaChain,
String key)
|
|
Criteria(String key)
|
| Method Summary | |
|---|---|
Criteria |
all(Collection<?> o)
Creates a criterion using the $all operator. |
Criteria |
all(Object... o)
Creates a criterion using the $all operator. |
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 |
elemMatch(Criteria c)
Creates a criterion using the $elemMatch operator |
boolean |
equals(Object obj)
|
Criteria |
exists(boolean b)
Creates a criterion using the $exists operator. |
com.mongodb.DBObject |
getCriteriaObject()
|
String |
getKey()
|
protected com.mongodb.DBObject |
getSingleCriteriaObject()
|
Criteria |
gt(Object o)
Creates a criterion using the $gt operator. |
Criteria |
gte(Object o)
Creates a criterion using the $gte operator. |
int |
hashCode()
|
Criteria |
in(Collection<?> c)
Creates a criterion using the $in operator. |
Criteria |
in(Object... o)
Creates a criterion using the $in operator. |
Criteria |
is(Object o)
Creates a criterion using equality |
Criteria |
lt(Object o)
Creates a criterion using the $lt operator. |
Criteria |
lte(Object o)
Creates a criterion using the $lte operator. |
Criteria |
maxDistance(double maxDistance)
Creates a geospatical criterion using a $maxDistance operation, for use with $near |
Criteria |
mod(Number value,
Number remainder)
Creates a criterion using the $mod operator. |
Criteria |
ne(Object o)
Creates a criterion using the $ne operator. |
Criteria |
near(Point point)
Creates a geospatial criterion using a $near operation. |
Criteria |
nearSphere(Point point)
Creates a geospatial criterion using a $nearSphere operation. |
Criteria |
nin(Collection<?> o)
Creates a criterion using the $nin operator. |
Criteria |
nin(Object... o)
Creates a criterion using the $nin operator. |
Criteria |
norOperator(Criteria... criteria)
Creates a 'nor' criteria using the $nor operator for all of the provided criteria. |
Criteria |
not()
Creates a criterion using the $not meta operator which affects the clause directly following |
Criteria |
orOperator(Criteria... criteria)
Creates an 'or' criteria using the $or operator for all of the provided criteria Note that mongodb doesn't support an $or operator to be wrapped in a $not operator. |
Criteria |
regex(Pattern pattern)
Syntactical sugar for is(Object) making obvious that we create a regex predicate. |
Criteria |
regex(String re)
Creates a criterion using a $regex operator. |
Criteria |
regex(String re,
String options)
Creates a criterion using a $regex and $options operator. |
Criteria |
size(int s)
Creates a criterion using the $size operator. |
Criteria |
type(int t)
Creates a criterion using the $type operator. |
static Criteria |
where(String key)
Static factory method to create a Criteria using the provided key |
Criteria |
within(Shape shape)
Creates a geospatial criterion using a $within operation. |
Criteria |
withinSphere(Circle circle)
Creates a geospatial criterion using a $within $centerSphere operation. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Criteria()
public Criteria(String key)
protected Criteria(List<Criteria> criteriaChain,
String key)
| Method Detail |
|---|
public static Criteria where(String key)
key -
public Criteria and(String key)
public Criteria is(Object o)
o -
public Criteria ne(Object o)
o -
http://docs.mongodb.org/manual/reference/operator/query/ne/public Criteria lt(Object o)
o -
http://docs.mongodb.org/manual/reference/operator/query/lt/public Criteria lte(Object o)
o -
http://docs.mongodb.org/manual/reference/operator/query/lte/public Criteria gt(Object o)
o -
http://docs.mongodb.org/manual/reference/operator/query/gt/public Criteria gte(Object o)
o -
http://docs.mongodb.org/manual/reference/operator/query/gte/public Criteria in(Object... o)
o - the values to match against
http://docs.mongodb.org/manual/reference/operator/query/in/public Criteria in(Collection<?> c)
c - the collection containing the values to match against
http://docs.mongodb.org/manual/reference/operator/query/in/public Criteria nin(Object... o)
o -
http://docs.mongodb.org/manual/reference/operator/query/nin/public Criteria nin(Collection<?> o)
o -
http://docs.mongodb.org/manual/reference/operator/query/nin/
public Criteria mod(Number value,
Number remainder)
value - remainder -
http://docs.mongodb.org/manual/reference/operator/query/mod/public Criteria all(Object... o)
o -
http://docs.mongodb.org/manual/reference/operator/query/all/public Criteria all(Collection<?> o)
o -
http://docs.mongodb.org/manual/reference/operator/query/all/public Criteria size(int s)
s -
http://docs.mongodb.org/manual/reference/operator/query/size/public Criteria exists(boolean b)
b -
http://docs.mongodb.org/manual/reference/operator/query/exists/public Criteria type(int t)
t -
http://docs.mongodb.org/manual/reference/operator/query/type/public Criteria not()
http://docs.mongodb.org/manual/reference/operator/query/not/public Criteria regex(String re)
re -
http://docs.mongodb.org/manual/reference/operator/query/regex/
public Criteria regex(String re,
String options)
re - options -
http://docs.mongodb.org/manual/reference/operator/query/regex/,
http://docs.mongodb.org/manual/reference/operator/query/regex/#op._S_optionspublic Criteria regex(Pattern pattern)
is(Object) making obvious that we create a regex predicate.
pattern -
public Criteria withinSphere(Circle circle)
circle - must not be null
http://docs.mongodb.org/manual/reference/operator/query/geoWithin/,
http://docs.mongodb.org/manual/reference/operator/query/centerSphere/public Criteria within(Shape shape)
shape -
http://docs.mongodb.org/manual/reference/operator/query/geoWithin/public Criteria near(Point point)
point - must not be null
http://docs.mongodb.org/manual/reference/operator/query/near/public Criteria nearSphere(Point point)
point - must not be null
http://docs.mongodb.org/manual/reference/operator/query/nearSphere/public Criteria maxDistance(double maxDistance)
maxDistance -
http://docs.mongodb.org/manual/reference/operator/query/maxDistance/public Criteria elemMatch(Criteria c)
c -
http://docs.mongodb.org/manual/reference/operator/query/elemMatch/public Criteria orOperator(Criteria... criteria)
Note that mongodb doesn't support an $or operator to be wrapped in a $not operator.
criteria -
IllegalArgumentException - if orOperator(Criteria...) follows a not() call directly.public Criteria norOperator(Criteria... criteria)
Note that mongodb doesn't support an $nor operator to be wrapped in a $not operator.
criteria -
IllegalArgumentException - if norOperator(Criteria...) follows a not() call directly.public Criteria andOperator(Criteria... criteria)
Note that mongodb doesn't support an $and operator to be wrapped in a $not operator.
criteria -
IllegalArgumentException - if andOperator(Criteria...) follows a not() call directly.public String getKey()
public com.mongodb.DBObject getCriteriaObject()
getCriteriaObject in interface CriteriaDefinitionprotected com.mongodb.DBObject getSingleCriteriaObject()
public boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
Spring Data MongoDB - Core | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||