Class BucketOperationSupport.OperationOutput
java.lang.Object
org.springframework.data.mongodb.core.aggregation.BucketOperationSupport.Output
org.springframework.data.mongodb.core.aggregation.BucketOperationSupport.OperationOutput
- All Implemented Interfaces:
AggregationExpression
,MongoExpression
- Enclosing class:
- BucketOperationSupport<T extends BucketOperationSupport<T,
B>, B extends BucketOperationSupport.OutputBuilder<B, T>>
Output field that uses a Mongo operation (expression object) to generate an output field value.
BucketOperationSupport.OperationOutput
is used either with a regular field name or an operation keyword (e.g.
$sum, $count).- Author:
- Mark Paluch
-
Constructor Summary
ConstructorDescriptionOperationOutput
(String operation, Collection<? extends Object> values) Creates a newBucketOperationSupport.Output
for the given field. -
Method Summary
Modifier and TypeMethodDescriptionprotected Field
getField()
Returns the field that holds theProjectionOperation.ProjectionOperationBuilder.OperationProjection
.org.bson.Document
toDocument
(AggregationOperationContext context) Creates a new instance of thisBucketOperationSupport.OperationOutput
with the given alias.Methods inherited from class org.springframework.data.mongodb.core.aggregation.BucketOperationSupport.Output
getExposedField
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.mongodb.core.aggregation.AggregationExpression
toDocument
-
Constructor Details
-
OperationOutput
Creates a newBucketOperationSupport.Output
for the given field.- Parameters:
operation
- the actual operation key, must not be null or empty.values
- the values to pass into the operation, must not be null.
-
-
Method Details
-
toDocument
Description copied from interface:AggregationExpression
- Parameters:
context
- must not be null.- Returns:
- the MongoDB native (
Document
) form of the expression.
-
getOperationArguments
-
getField
Returns the field that holds theProjectionOperation.ProjectionOperationBuilder.OperationProjection
.- Returns:
- never null.
-
withAlias
Creates a new instance of thisBucketOperationSupport.OperationOutput
with the given alias.- Parameters:
alias
- the alias to set- Returns:
- new instance of
BucketOperationSupport.OperationOutput
.
-