@CompileStatic class MongoStaticApi<D> extends GormStaticApi<D> implements MongoAllOperations<D>
MongoDB static API implementation
| Constructor and description |
|---|
MongoStaticApi(Class<D> persistentClass, Datastore datastore, List<FinderMethod> finders, PlatformTransactionManager transactionManager) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
List<D> |
aggregate(List pipeline, Function<AggregateIterable, AggregateIterable> doWithAggregate) |
|
List<D> |
aggregate(List pipeline, Function<AggregateIterable, AggregateIterable> doWithAggregate, ReadPreference readPreference) |
|
Number |
count(Bson filter) |
|
int |
countHits(String query) |
|
MongoCriteriaBuilder |
createCriteria() |
|
FindIterable<D> |
find(Bson filter) |
|
D |
findOneAndDelete(Bson filter, FindOneAndDeleteOptions options) |
|
MongoCollection<Document> |
getCollection() |
|
String |
getCollectionName() |
|
MongoDatabase |
getDB() |
|
List<D> |
search(String query, Map options) |
|
List<D> |
searchTop(String query, int limit, Map options) |
|
String |
useCollection(String collectionName) |
|
String |
useDatabase(String databaseName) |
<T> |
T |
withCollection(String collectionName, Closure<T> callable) |
<T> |
T |
withDatabase(String databaseName, Closure<T> callable) |
|
protected Bson |
wrapFilterWithMultiTenancy(Bson filter) |