Class TypedAggregation<I>
java.lang.Object
org.springframework.data.mongodb.core.aggregation.Aggregation
org.springframework.data.mongodb.core.aggregation.TypedAggregation<I>
A
TypedAggregation
is a special Aggregation
that holds information of the input aggregation type.- Author:
- Thomas Darimont, Oliver Gierke
-
Field Summary
Fields inherited from class org.springframework.data.mongodb.core.aggregation.Aggregation
CURRENT, DEFAULT_CONTEXT, DEFAULT_OPTIONS, pipeline, REMOVE, ROOT
-
Constructor Summary
ConstructorDescriptionTypedAggregation
(Class<I> inputType, List<AggregationOperation> operations) Creates a newTypedAggregation
from the givenAggregationOperation
s.TypedAggregation
(Class<I> inputType, List<AggregationOperation> operations, AggregationOptions options) Creates a newTypedAggregation
from the givenAggregationOperation
s and the givenAggregationOptions
.TypedAggregation
(Class<I> inputType, AggregationOperation... operations) Creates a newTypedAggregation
from the givenAggregationOperation
s. -
Method Summary
Modifier and TypeMethodDescriptionReturns the input type for theAggregation
.withOptions
(AggregationOptions options) Returns a copy of thisAggregation
with the givenAggregationOptions
set.Methods inherited from class org.springframework.data.mongodb.core.aggregation.Aggregation
addFields, asAggregationList, bind, bucket, bucket, bucketAuto, bucketAuto, count, facet, facet, fields, geoNear, getOptions, getPipeline, graphLookup, group, group, limit, lookup, lookup, lookup, match, match, match, merge, newAggregation, newAggregation, newAggregation, newAggregation, newAggregationOptions, newUpdate, out, previousOperation, project, project, project, redact, replaceRoot, replaceRoot, replaceRoot, sample, skip, sort, sort, sortByCount, sortByCount, stage, stage, toDocument, toPipeline, toString, unwind, unwind, unwind, unwind
-
Constructor Details
-
TypedAggregation
Creates a newTypedAggregation
from the givenAggregationOperation
s.- Parameters:
inputType
- must not be null.operations
- must not be null or empty.
-
TypedAggregation
Creates a newTypedAggregation
from the givenAggregationOperation
s.- Parameters:
inputType
- must not be null.operations
- must not be null or empty.
-
TypedAggregation
public TypedAggregation(Class<I> inputType, List<AggregationOperation> operations, AggregationOptions options) Creates a newTypedAggregation
from the givenAggregationOperation
s and the givenAggregationOptions
.- Parameters:
inputType
- must not be null.operations
- must not be null or empty.options
- must not be null.
-
-
Method Details
-
getInputType
Returns the input type for theAggregation
.- Returns:
- the inputType will never be null.
-
withOptions
Description copied from class:Aggregation
Returns a copy of thisAggregation
with the givenAggregationOptions
set. Note that options are supported in MongoDB version 2.6+.- Overrides:
withOptions
in classAggregation
- Parameters:
options
- must not be null.- Returns:
- new instance of
Aggregation
.
-