| Package | Description |
|---|---|
| org.springframework.data.mongodb.core |
MongoDB core support.
|
| org.springframework.data.mongodb.core.query |
MongoDB specific query and update support.
|
| org.springframework.data.mongodb.gridfs |
Support for MongoDB GridFS feature.
|
| org.springframework.data.mongodb.repository.query |
Query derivation mechanism for MongoDB specific repositories.
|
| Modifier and Type | Method and Description |
|---|---|
long |
MongoOperations.count(Query query,
Class<?> entityClass)
Returns the number of documents for the given
Query by querying the collection of the given entity class. |
long |
MongoTemplate.count(Query query,
Class<?> entityClass) |
long |
MongoOperations.count(Query query,
String collectionName)
Returns the number of documents for the given
Query querying the given collection. |
long |
MongoTemplate.count(Query query,
String collectionName) |
protected <T> List<T> |
MongoTemplate.doFindAndDelete(String collectionName,
Query query,
Class<T> entityClass)
Retrieve and remove all documents matching the given
query by calling MongoTemplate.find(Query, Class, String)
and MongoTemplate.remove(Query, Class, String), whereas the Query for MongoTemplate.remove(Query, Class, String) is
constructed out of the find result. |
protected <T> com.mongodb.WriteResult |
MongoTemplate.doRemove(String collectionName,
Query query,
Class<T> entityClass) |
protected com.mongodb.WriteResult |
MongoTemplate.doUpdate(String collectionName,
Query query,
Update update,
Class<?> entityClass,
boolean upsert,
boolean multi) |
void |
MongoOperations.executeQuery(Query query,
String collectionName,
DocumentCallbackHandler dch)
Execute a MongoDB query and iterate over the query results on a per-document basis with a DocumentCallbackHandler.
|
void |
MongoTemplate.executeQuery(Query query,
String collectionName,
DocumentCallbackHandler dch) |
protected void |
MongoTemplate.executeQuery(Query query,
String collectionName,
DocumentCallbackHandler dch,
org.springframework.data.mongodb.core.CursorPreparer preparer)
Execute a MongoDB query and iterate over the query results on a per-document basis with a
DocumentCallbackHandler using the provided CursorPreparer. |
boolean |
MongoOperations.exists(Query query,
Class<?> entityClass)
Determine result of given
Query contains at least one element. |
boolean |
MongoTemplate.exists(Query query,
Class<?> entityClass) |
boolean |
MongoOperations.exists(Query query,
Class<?> entityClass,
String collectionName)
Determine result of given
Query contains at least one element. |
boolean |
MongoTemplate.exists(Query query,
Class<?> entityClass,
String collectionName) |
boolean |
MongoOperations.exists(Query query,
String collectionName)
Determine result of given
Query contains at least one element. |
boolean |
MongoTemplate.exists(Query query,
String collectionName) |
<T> List<T> |
MongoOperations.find(Query query,
Class<T> entityClass)
Map the results of an ad-hoc query on the collection for the entity class to a List of the specified type.
|
<T> List<T> |
MongoTemplate.find(Query query,
Class<T> entityClass) |
<T> List<T> |
MongoOperations.find(Query query,
Class<T> entityClass,
String collectionName)
Map the results of an ad-hoc query on the specified collection to a List of the specified type.
|
<T> List<T> |
MongoTemplate.find(Query query,
Class<T> entityClass,
String collectionName) |
<T> List<T> |
MongoOperations.findAllAndRemove(Query query,
Class<T> entityClass)
Returns and removes all documents matching the given query form the collection used to store the entityClass.
|
<T> List<T> |
MongoTemplate.findAllAndRemove(Query query,
Class<T> entityClass) |
<T> List<T> |
MongoOperations.findAllAndRemove(Query query,
Class<T> entityClass,
String collectionName)
Returns and removes all documents that match the provided query document criteria from the the collection used to
store the entityClass.
|
<T> List<T> |
MongoTemplate.findAllAndRemove(Query query,
Class<T> entityClass,
String collectionName) |
<T> List<T> |
MongoOperations.findAllAndRemove(Query query,
String collectionName)
Returns and removes all documents form the specified collection that match the provided query.
|
<T> List<T> |
MongoTemplate.findAllAndRemove(Query query,
String collectionName) |
<T> T |
MongoOperations.findAndModify(Query query,
Update update,
Class<T> entityClass)
|
<T> T |
MongoTemplate.findAndModify(Query query,
Update update,
Class<T> entityClass) |
<T> T |
MongoOperations.findAndModify(Query query,
Update update,
Class<T> entityClass,
String collectionName)
|
<T> T |
MongoTemplate.findAndModify(Query query,
Update update,
Class<T> entityClass,
String collectionName) |
<T> T |
MongoOperations.findAndModify(Query query,
Update update,
FindAndModifyOptions options,
Class<T> entityClass)
Triggers findAndModify
to apply provided
Update on documents matching Criteria of given Query taking
FindAndModifyOptions into account. |
<T> T |
MongoTemplate.findAndModify(Query query,
Update update,
FindAndModifyOptions options,
Class<T> entityClass) |
<T> T |
MongoOperations.findAndModify(Query query,
Update update,
FindAndModifyOptions options,
Class<T> entityClass,
String collectionName)
Triggers findAndModify
to apply provided
Update on documents matching Criteria of given Query taking
FindAndModifyOptions into account. |
<T> T |
MongoTemplate.findAndModify(Query query,
Update update,
FindAndModifyOptions options,
Class<T> entityClass,
String collectionName) |
<T> T |
MongoOperations.findAndRemove(Query query,
Class<T> entityClass)
Map the results of an ad-hoc query on the collection for the entity type to a single instance of an object of the
specified type.
|
<T> T |
MongoTemplate.findAndRemove(Query query,
Class<T> entityClass) |
<T> T |
MongoOperations.findAndRemove(Query query,
Class<T> entityClass,
String collectionName)
Map the results of an ad-hoc query on the specified collection to a single instance of an object of the specified
type.
|
<T> T |
MongoTemplate.findAndRemove(Query query,
Class<T> entityClass,
String collectionName) |
<T> T |
MongoOperations.findOne(Query query,
Class<T> entityClass)
Map the results of an ad-hoc query on the collection for the entity class to a single instance of an object of the
specified type.
|
<T> T |
MongoTemplate.findOne(Query query,
Class<T> entityClass) |
<T> T |
MongoOperations.findOne(Query query,
Class<T> entityClass,
String collectionName)
Map the results of an ad-hoc query on the specified collection to a single instance of an object of the specified
type.
|
<T> T |
MongoTemplate.findOne(Query query,
Class<T> entityClass,
String collectionName) |
<T> MapReduceResults<T> |
MongoOperations.mapReduce(Query query,
String inputCollectionName,
String mapFunction,
String reduceFunction,
Class<T> entityClass)
Execute a map-reduce operation that takes a query.
|
<T> MapReduceResults<T> |
MongoTemplate.mapReduce(Query query,
String inputCollectionName,
String mapFunction,
String reduceFunction,
Class<T> entityClass) |
<T> MapReduceResults<T> |
MongoOperations.mapReduce(Query query,
String inputCollectionName,
String mapFunction,
String reduceFunction,
MapReduceOptions mapReduceOptions,
Class<T> entityClass)
Execute a map-reduce operation that takes a query and additional map-reduce options
|
<T> MapReduceResults<T> |
MongoTemplate.mapReduce(Query query,
String inputCollectionName,
String mapFunction,
String reduceFunction,
MapReduceOptions mapReduceOptions,
Class<T> entityClass) |
com.mongodb.WriteResult |
MongoOperations.remove(Query query,
Class<?> entityClass)
Remove all documents that match the provided query document criteria from the the collection used to store the
entityClass.
|
com.mongodb.WriteResult |
MongoTemplate.remove(Query query,
Class<?> entityClass) |
com.mongodb.WriteResult |
MongoOperations.remove(Query query,
Class<?> entityClass,
String collectionName)
Remove all documents that match the provided query document criteria from the the collection used to store the
entityClass.
|
com.mongodb.WriteResult |
MongoTemplate.remove(Query query,
Class<?> entityClass,
String collectionName) |
com.mongodb.WriteResult |
MongoOperations.remove(Query query,
String collectionName)
Remove all documents from the specified collection that match the provided query document criteria.
|
com.mongodb.WriteResult |
MongoTemplate.remove(Query query,
String collectionName) |
com.mongodb.WriteResult |
MongoOperations.updateFirst(Query query,
Update update,
Class<?> entityClass)
Updates the first object that is found in the collection of the entity class that matches the query document with
the provided update document.
|
com.mongodb.WriteResult |
MongoTemplate.updateFirst(Query query,
Update update,
Class<?> entityClass) |
com.mongodb.WriteResult |
MongoOperations.updateFirst(Query query,
Update update,
Class<?> entityClass,
String collectionName)
Updates the first object that is found in the specified collection that matches the query document criteria with
the provided updated document.
|
com.mongodb.WriteResult |
MongoTemplate.updateFirst(Query query,
Update update,
Class<?> entityClass,
String collectionName) |
com.mongodb.WriteResult |
MongoOperations.updateFirst(Query query,
Update update,
String collectionName)
Updates the first object that is found in the specified collection that matches the query document criteria with
the provided updated document.
|
com.mongodb.WriteResult |
MongoTemplate.updateFirst(Query query,
Update update,
String collectionName) |
com.mongodb.WriteResult |
MongoOperations.updateMulti(Query query,
Update update,
Class<?> entityClass)
Updates all objects that are found in the collection for the entity class that matches the query document criteria
with the provided updated document.
|
com.mongodb.WriteResult |
MongoTemplate.updateMulti(Query query,
Update update,
Class<?> entityClass) |
com.mongodb.WriteResult |
MongoOperations.updateMulti(Query query,
Update update,
Class<?> entityClass,
String collectionName)
Updates all objects that are found in the collection for the entity class that matches the query document criteria
with the provided updated document.
|
com.mongodb.WriteResult |
MongoTemplate.updateMulti(Query query,
Update update,
Class<?> entityClass,
String collectionName) |
com.mongodb.WriteResult |
MongoOperations.updateMulti(Query query,
Update update,
String collectionName)
Updates all objects that are found in the specified collection that matches the query document criteria with the
provided updated document.
|
com.mongodb.WriteResult |
MongoTemplate.updateMulti(Query query,
Update update,
String collectionName) |
com.mongodb.WriteResult |
MongoOperations.upsert(Query query,
Update update,
Class<?> entityClass)
Performs an upsert.
|
com.mongodb.WriteResult |
MongoTemplate.upsert(Query query,
Update update,
Class<?> entityClass) |
com.mongodb.WriteResult |
MongoOperations.upsert(Query query,
Update update,
Class<?> entityClass,
String collectionName)
Performs an upsert.
|
com.mongodb.WriteResult |
MongoTemplate.upsert(Query query,
Update update,
Class<?> entityClass,
String collectionName) |
com.mongodb.WriteResult |
MongoOperations.upsert(Query query,
Update update,
String collectionName)
Performs an upsert.
|
com.mongodb.WriteResult |
MongoTemplate.upsert(Query query,
Update update,
String collectionName) |
| Modifier and Type | Class and Description |
|---|---|
class |
BasicQuery
Custom
Query implementation to setup a basic query from some arbitrary JSON query string. |
class |
TextQuery
Query implementation to be used to for performing full text searches. |
| Modifier and Type | Method and Description |
|---|---|
Query |
BasicQuery.addCriteria(CriteriaDefinition criteria) |
Query |
Query.addCriteria(CriteriaDefinition criteriaDefinition)
Adds the given
CriteriaDefinition to the current Query. |
Query |
Query.comment(String comment) |
Query |
Query.limit(int limit)
Limit the number of returned documents to
limit. |
Query |
Query.maxScan(long maxScan) |
Query |
Query.maxTime(long timeout,
TimeUnit timeUnit) |
Query |
Query.maxTimeMsec(long maxTimeMsec) |
static Query |
Query.query(CriteriaDefinition criteriaDefinition)
Static factory method to create a
Query using the provided CriteriaDefinition. |
Query |
Query.restrict(Class<?> type,
Class<?>... additionalTypes)
Restricts the query to only return documents instances that are exactly of the given types.
|
Query |
Query.skip(int skip)
Set number of documents to skip before returning results.
|
Query |
Query.useSnapshot() |
Query |
Query.with(Pageable pageable)
Sets the given pagination information on the
Query instance. |
Query |
Query.with(Sort sort)
|
Query |
Query.withHint(String name)
Configures the query to use the given hint when being executed.
|
| Modifier and Type | Method and Description |
|---|---|
NearQuery |
NearQuery.query(Query query)
Adds an actual query to the
NearQuery to restrict the objects considered for the actual near operation. |
| Modifier and Type | Method and Description |
|---|---|
void |
GridFsTemplate.delete(Query query) |
void |
GridFsOperations.delete(Query query)
Deletes all files matching the given
Query. |
List<com.mongodb.gridfs.GridFSDBFile> |
GridFsTemplate.find(Query query) |
List<com.mongodb.gridfs.GridFSDBFile> |
GridFsOperations.find(Query query)
Returns all files matching the given query.
|
com.mongodb.gridfs.GridFSDBFile |
GridFsTemplate.findOne(Query query) |
com.mongodb.gridfs.GridFSDBFile |
GridFsOperations.findOne(Query query)
Returns a single file matching the given query or null in case no file matches.
|
| Modifier and Type | Method and Description |
|---|---|
protected Query |
AbstractMongoQuery.createCountQuery(ConvertingParameterAccessor accessor)
Creates a
Query instance using the given ConvertingParameterAccessor. |
protected Query |
PartTreeMongoQuery.createCountQuery(ConvertingParameterAccessor accessor) |
protected abstract Query |
AbstractMongoQuery.createQuery(ConvertingParameterAccessor accessor)
Creates a
Query instance using the given ParameterAccessor |
protected Query |
StringBasedMongoQuery.createQuery(ConvertingParameterAccessor accessor) |
protected Query |
PartTreeMongoQuery.createQuery(ConvertingParameterAccessor accessor) |
Copyright © 2011-2014–2014 Pivotal Software, Inc.. All rights reserved.