Module spring.data.mongodb
Class ObjectOperators.ObjectOperatorFactory
java.lang.Object
org.springframework.data.mongodb.core.aggregation.ObjectOperators.ObjectOperatorFactory
- Enclosing class:
- ObjectOperators
- Author:
- Christoph Strobl
-
Constructor Summary
ConstructorsConstructorDescriptionObjectOperatorFactory(Object value) Creates newObjectOperators.ObjectOperatorFactoryfor given value. -
Method Summary
Modifier and TypeMethodDescriptionCreates newaggregation expressionthat takes the associated value and obtains the value of the field with matching name.merge()Creates newaggregation expressionthat takes the associated value and uses $mergeObjects as an accumulator within the $group stage.Creates newaggregation expressionthat takes the associated value and combines it with the given values (documents or mapped objects) into a single document.mergeWithValuesOf(String... fieldReferences) Creates newaggregation expressionthat takes the associated value and combines it with the values of the givenfield referencesinto a single document.mergeWithValuesOf(AggregationExpression... expression) Creates newaggregation expressionthat takes the associated value and combines it with the result values of the givenexpressionsinto a single document.removeField(String fieldName) Creates newaggregation expressionthat takes the associated value and obtains the value of the field with matching name.Creates newaggregation expressionthat takes the associated value and obtains the value of the field with matching name.toArray()Creates newaggregation expressionthat takes the associated value and converts it to an array ofdocumentsthat contain two fields k and v each.
-
Constructor Details
-
ObjectOperatorFactory
Creates newObjectOperators.ObjectOperatorFactoryfor given value.- Parameters:
value- must not be null.
-
-
Method Details
-
merge
Creates newaggregation expressionthat takes the associated value and uses $mergeObjects as an accumulator within the $group stage.
NOTE: Requires MongoDB 4.0 or later.- Returns:
- new instance of
ObjectOperators.MergeObjects.
-
mergeWith
Creates newaggregation expressionthat takes the associated value and combines it with the given values (documents or mapped objects) into a single document.
NOTE: Requires MongoDB 4.0 or later.- Returns:
- new instance of
ObjectOperators.MergeObjects.
-
mergeWithValuesOf
Creates newaggregation expressionthat takes the associated value and combines it with the values of the givenfield referencesinto a single document.
NOTE: Requires MongoDB 4.0 or later.- Returns:
- new instance of
ObjectOperators.MergeObjects.
-
mergeWithValuesOf
Creates newaggregation expressionthat takes the associated value and combines it with the result values of the givenexpressionsinto a single document.
NOTE: Requires MongoDB 4.0 or later.- Returns:
- new instance of
ObjectOperators.MergeObjects.
-
toArray
Creates newaggregation expressionthat takes the associated value and converts it to an array ofdocumentsthat contain two fields k and v each.
NOTE: Requires MongoDB 3.6 or later.- Since:
- 2.1
-
getField
Creates newaggregation expressionthat takes the associated value and obtains the value of the field with matching name.- Since:
- 4.0
-
setField
Creates newaggregation expressionthat takes the associated value and obtains the value of the field with matching name.- Since:
- 4.0
-
removeField
Creates newaggregation expressionthat takes the associated value and obtains the value of the field with matching name.- Since:
- 4.0
-