interface MongoStaticOperations<D> extends GormStaticOperations<D>
Static operations for GORM for MongoDB
| Type Params | Return Type | Name and description |
|---|---|---|
|
abstract java.util.List<D> |
aggregate(java.util.List pipeline)Execute a MongoDB aggregation pipeline. |
|
abstract java.util.List<D> |
aggregate(java.util.List pipeline, java.util.function.Function<com.mongodb.client.AggregateIterable, com.mongodb.client.AggregateIterable> doWithAggregate)Execute a MongoDB aggregation pipeline. |
|
abstract java.util.List<D> |
aggregate(java.util.List pipeline, java.util.function.Function<com.mongodb.client.AggregateIterable, com.mongodb.client.AggregateIterable> doWithAggregate, com.mongodb.ReadPreference readPreference)Execute a MongoDB aggregation pipeline. |
|
abstract int |
countHits(java.lang.String query)Counts the number of hits |
|
abstract MongoCriteriaBuilder |
createCriteria()
|
|
abstract com.mongodb.client.FindIterable<D> |
find(org.bson.conversions.Bson filter)Find an entity for the given filter |
|
abstract D |
findOneAndDelete(org.bson.conversions.Bson filter)Atomically find a document and remove it. |
|
abstract D |
findOneAndDelete(org.bson.conversions.Bson filter, com.mongodb.client.model.FindOneAndDeleteOptions options)Atomically find a document and remove it. |
|
abstract com.mongodb.client.MongoCollection<org.bson.Document> |
getCollection()The actual collection that this entity maps to. |
|
abstract java.lang.String |
getCollectionName()
|
|
abstract com.mongodb.client.MongoDatabase |
getDB()
|
|
abstract java.util.List<D> |
search(java.lang.String query)Search for entities using the given query |
|
abstract java.util.List<D> |
search(java.lang.String query, java.util.Map options)Search for entities using the given query |
|
abstract java.util.List<D> |
searchTop(java.lang.String query)Searches for the top results ordered by the MongoDB score |
|
abstract java.util.List<D> |
searchTop(java.lang.String query, int limit)Searches for the top results ordered by the MongoDB score |
|
abstract java.util.List<D> |
searchTop(java.lang.String query, int limit, java.util.Map options)Searches for the top results ordered by the MongoDB score |
|
abstract java.lang.String |
useCollection(java.lang.String collectionName)Use the given collection for this entity for the scope of the session |
|
abstract java.lang.String |
useDatabase(java.lang.String databaseName)Use the given database for this entity for the scope of the session |
<T> |
abstract T |
withCollection(java.lang.String collectionName, Closure<T> callable)Use the given collection for this entity for the scope of the closure call |
<T> |
abstract T |
withDatabase(java.lang.String databaseName, Closure<T> callable)Use the given database for this entity for the scope of the closure call |
Execute a MongoDB aggregation pipeline. Note that the pipeline should return documents that represent this domain class as each return document will be converted to a domain instance in the result set
pipeline - The pipelineExecute a MongoDB aggregation pipeline. Note that the pipeline should return documents that represent this domain class as each return document will be converted to a domain instance in the result set
pipeline - The pipelinedoWithAggregate - A callback to modify the aggregate iterableExecute a MongoDB aggregation pipeline. Note that the pipeline should return documents that represent this domain class as each return document will be converted to a domain instance in the result set
pipeline - The pipelinedoWithAggregate - A callback to modify the aggregate iterableCounts the number of hits
query - The query
Find an entity for the given filter
filter - The filterAtomically find a document and remove it.
filter - the query filter to find the document withAtomically find a document and remove it.
filter - the query filter to find the document withThe actual collection that this entity maps to.
Search for entities using the given query
query - The querySearch for entities using the given query
query - The querySearches for the top results ordered by the MongoDB score
query - The querySearches for the top results ordered by the MongoDB score
query - The querylimit - The maximum number of results. Defaults to 5.Searches for the top results ordered by the MongoDB score
query - The querylimit - The maximum number of results. Defaults to 5.Use the given collection for this entity for the scope of the session
collectionName - The collection nameUse the given database for this entity for the scope of the session
databaseName - The collection nameUse the given collection for this entity for the scope of the closure call
collectionName - The collection namecallable - The callableUse the given database for this entity for the scope of the closure call
databaseName - The collection namecallable - The callable