Module spring.data.mongodb
Interface ExecutableAggregationOperation
- All Known Subinterfaces:
FluentMongoOperations,MongoOperations
- All Known Implementing Classes:
MongoTemplate
public interface ExecutableAggregationOperation
ExecutableAggregationOperation allows creation and execution of MongoDB aggregation operations in a fluent
API style. The starting domainType is used for mapping the
Aggregation provided via by into the
MongoDB specific representation, as well as mapping back the resulting Document. An alternative
input type for mapping the Aggregation can be provided by using
TypedAggregation.
aggregateAndReturn(Jedi.class)
.by(newAggregation(Human.class, project("These are not the droids you are looking for")))
.all();
- Since:
- 2.0
- Author:
- Christoph Strobl, Mark Paluch
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceDefine the aggregation with pipeline stages.static interfaceCollection override (Optional).static interfacestatic interfaceTrigger execution by calling one of the terminating methods. -
Method Summary
Modifier and TypeMethodDescriptionaggregateAndReturn(Class<T> domainType) Start creating an aggregation operation that returns results mapped to the given domain type.
-
Method Details
-
aggregateAndReturn
Start creating an aggregation operation that returns results mapped to the given domain type.
UseTypedAggregationto specify a potentially different input type for he aggregation.- Parameters:
domainType- must not be null.- Returns:
- new instance of
ExecutableAggregationOperation.ExecutableAggregation. - Throws:
IllegalArgumentException- if domainType is null.
-