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).- Since:
- 1.10
- Author:
- Mark Paluch
-
Constructor Summary
ConstructorsConstructorDescriptionOperationOutput(String operation, Collection<? extends Object> values) Creates a newBucketOperationSupport.Outputfor the given field. -
Method Summary
Modifier and TypeMethodDescriptionprotected FieldgetField()Returns the field that holds theProjectionOperation.ProjectionOperationBuilder.OperationProjection.org.bson.DocumenttoDocument(AggregationOperationContext context) Creates a new instance of thisBucketOperationSupport.OperationOutputwith the given alias.Methods inherited from class BucketOperationSupport.Output
getExposedFieldMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AggregationExpression
toDocument
-
Constructor Details
-
OperationOutput
Creates a newBucketOperationSupport.Outputfor 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.OperationOutputwith the given alias.- Parameters:
alias- the alias to set- Returns:
- new instance of
BucketOperationSupport.OperationOutput.
-