Module spring.data.mongodb
Class ObjectOperators
java.lang.Object
org.springframework.data.mongodb.core.aggregation.ObjectOperators
Gateway for
object
expression operators.
- Since:
- 2.1
- Author:
- Christoph Strobl
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAggregationExpressionfor$getField.static classAggregationExpressionfor$mergeObjectsthat combines multiple documents into a single document.static classstatic classAggregationExpressionfor$objectToArraythat converts a document to an array ofdocumentsthat each contains two fields k and v.static classAggregationExpressionfor$setField. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AggregationExpressiongetValueOf(String fieldName) Get the value of the field with given name from the $$CURRENT object.static AggregationExpressionsetValueTo(String fieldName, Object value) Set the value of the field with given name on the $$CURRENT object.Take the value referenced by given fieldReference.valueOf(AggregationExpression expression) Take the value provided by the givenAggregationExpression.valueOf(SystemVariable variable) Use the value from the givenSystemVariableas input for the targetexpression.
-
Constructor Details
-
ObjectOperators
public ObjectOperators()
-
-
Method Details
-
valueOf
Take the value referenced by given fieldReference.- Parameters:
fieldReference- must not be null.- Returns:
- new instance of
ObjectOperators.ObjectOperatorFactory.
-
valueOf
Take the value provided by the givenAggregationExpression.- Parameters:
expression- must not be null.- Returns:
- new instance of
ObjectOperators.ObjectOperatorFactory.
-
valueOf
Use the value from the givenSystemVariableas input for the targetexpression.- Parameters:
variable- theSystemVariableto use (eg.SystemVariable.ROOT.- Returns:
- new instance of
ObjectOperators.ObjectOperatorFactory. - Since:
- 4.2
-
getValueOf
Get the value of the field with given name from the $$CURRENT object. Short version forObjectOperators.valueOf("$$CURRENT").getField(fieldName).- Parameters:
fieldName- the field name.- Returns:
- new instance of
AggregationExpression. - Since:
- 4.2
-
setValueTo
Set the value of the field with given name on the $$CURRENT object. Short version forObjectOperators.valueOf($$CURRENT).setField(fieldName).toValue(value).- Parameters:
fieldName- the field name.- Returns:
- new instance of
AggregationExpression. - Since:
- 4.2
-