public class Query extends Object
| Modifier and Type | Method and Description |
|---|---|
Query |
addCriteria(Criteria criteria)
|
boolean |
equals(Object obj) |
Field |
fields() |
protected List<Criteria> |
getCriteria() |
com.mongodb.DBObject |
getFieldsObject() |
String |
getHint() |
int |
getLimit()
Get the maximum number of documents to be return.
|
com.mongodb.DBObject |
getQueryObject() |
Set<Class<?>> |
getRestrictedTypes() |
int |
getSkip()
Get the number of documents to skip.
|
com.mongodb.DBObject |
getSortObject() |
int |
hashCode() |
static boolean |
isRestrictedTypeKey(String key)
Deprecated.
don't call this method as the restricted type handling will undergo some significant changes going
forward.
|
Query |
limit(int limit)
Limit the number of returned documents to
limit. |
static Query |
query(Criteria criteria)
|
Query |
restrict(Class<?> type,
Class<?>... additionalTypes)
Restricts the query to only return documents instances that are exactly of the given types.
|
Query |
skip(int skip)
Set number of documents to skip before returning results.
|
String |
toString() |
Query |
with(org.springframework.data.domain.Pageable pageable)
Sets the given pagination information on the
Query instance. |
Query |
with(org.springframework.data.domain.Sort sort)
Adds a
Sort to the Query instance. |
Query |
withHint(String name)
Configures the query to use the given hint when being executed.
|
public Query()
public Query(Criteria criteria)
criteria - must not be null.public static Query query(Criteria criteria)
criteria - must not be null.public Query addCriteria(Criteria criteria)
criteria - must not be null.public Field fields()
public Query skip(int skip)
skip - public Query limit(int limit)
limit.limit - public Query withHint(String name)
name - must not be null or empty.public Query with(org.springframework.data.domain.Pageable pageable)
Query instance. Will transparently set skip and
limit as well as applying the Sort instance defined with the Pageable.pageable - public Query with(org.springframework.data.domain.Sort sort)
Sort to the Query instance.sort - public Query restrict(Class<?> type, Class<?>... additionalTypes)
type - may not be nulladditionalTypes - may not be nullpublic com.mongodb.DBObject getQueryObject()
public com.mongodb.DBObject getFieldsObject()
public com.mongodb.DBObject getSortObject()
public int getSkip()
public int getLimit()
public String getHint()
@Deprecated public static boolean isRestrictedTypeKey(String key)
key - Copyright © 2021. All rights reserved.