Module spring.data.mongodb
Class ConvertOperators.ConvertOperatorFactory
java.lang.Object
org.springframework.data.mongodb.core.aggregation.ConvertOperators.ConvertOperatorFactory
- Enclosing class:
- ConvertOperators
- Author:
- Christoph Strobl
-
Constructor Summary
ConstructorsConstructorDescriptionConvertOperatorFactory(String fieldReference) Creates newConvertOperators.ConvertOperatorFactoryfor given fieldReference.ConvertOperatorFactory(AggregationExpression expression) Creates newConvertOperators.ConvertOperatorFactoryfor givenAggregationExpression. -
Method Summary
Modifier and TypeMethodDescriptionAggregationExpressionfor$degreesToRadiansthat converts an input value measured in degrees to radians.convertTo(int numericTypeIdentifier) Creates newaggregation expressionthat takes the associated value and converts it into the type specified by the givennumericTypeIdentifier.Creates newaggregation expressionthat takes the associated value and converts it into the type specified by the givenstringTypeIdentifier.Creates newaggregation expressionthat takes the associated value and converts it into the type specified by the givenJsonSchemaObject.Type.Creates newaggregation expressionfor$toBoolthat converts a value to boolean.Creates newaggregation expressionfor$toDatethat converts a value to a date.Creates newaggregation expressionfor$toDecimalthat converts a value to a decimal.Creates newaggregation expressionfor$toDoublethat converts a value to a decimal.Creates newaggregation expressionfor$toIntthat converts a value to an int.Creates newaggregation expressionfor$toLongthat converts a value to a long.Creates newaggregation expressionfor$toObjectIdthat converts a value to a objectId.Creates newaggregation expressionfor$toStringthat converts a value to a string.convertToTypeOf(String fieldReference) Creates newaggregation expressionthat takes the associated value and converts it into the type specified by the value of the givenfield reference.convertToTypeOf(AggregationExpression expression) Creates newaggregation expressionthat takes the associated value and converts it into the type specified by the givenexpression.
-
Constructor Details
-
ConvertOperatorFactory
Creates newConvertOperators.ConvertOperatorFactoryfor given fieldReference.- Parameters:
fieldReference- must not be null.
-
ConvertOperatorFactory
Creates newConvertOperators.ConvertOperatorFactoryfor givenAggregationExpression.- Parameters:
expression- must not be null.
-
-
Method Details
-
convertTo
Creates newaggregation expressionthat takes the associated value and converts it into the type specified by the givenstringTypeIdentifier.
NOTE: Requires MongoDB 4.0 or later.- Parameters:
stringTypeIdentifier- must not be null.- Returns:
- new instance of
ConvertOperators.Convert.
-
convertTo
Creates newaggregation expressionthat takes the associated value and converts it into the type specified by the givennumericTypeIdentifier.
NOTE: Requires MongoDB 4.0 or later.- Parameters:
numericTypeIdentifier- must not be null.- Returns:
- new instance of
ConvertOperators.Convert.
-
convertTo
Creates newaggregation expressionthat takes the associated value and converts it into the type specified by the givenJsonSchemaObject.Type.
NOTE: Requires MongoDB 4.0 or later.- Parameters:
type- must not be null.- Returns:
- new instance of
ConvertOperators.Convert.
-
convertToTypeOf
Creates newaggregation expressionthat takes the associated value and converts it into the type specified by the value of the givenfield reference.
NOTE: Requires MongoDB 4.0 or later.- Parameters:
fieldReference- must not be null.- Returns:
- new instance of
ConvertOperators.Convert.
-
convertToTypeOf
Creates newaggregation expressionthat takes the associated value and converts it into the type specified by the givenexpression.
NOTE: Requires MongoDB 4.0 or later.- Parameters:
expression- must not be null.- Returns:
- new instance of
ConvertOperators.Convert.
-
convertToBoolean
Creates newaggregation expressionfor$toBoolthat converts a value to boolean. Shorthand for#convertTo("bool").
NOTE: Requires MongoDB 4.0 or later.- Returns:
- new instance of
ConvertOperators.ToBool.
-
convertToDate
Creates newaggregation expressionfor$toDatethat converts a value to a date. Shorthand for#convertTo("date").
NOTE: Requires MongoDB 4.0 or later.- Returns:
- new instance of
ConvertOperators.ToDate.
-
convertToDecimal
Creates newaggregation expressionfor$toDecimalthat converts a value to a decimal. Shorthand for#convertTo("decimal").
NOTE: Requires MongoDB 4.0 or later.- Returns:
- new instance of
ConvertOperators.ToDecimal.
-
convertToDouble
Creates newaggregation expressionfor$toDoublethat converts a value to a decimal. Shorthand for#convertTo("double").
NOTE: Requires MongoDB 4.0 or later.- Returns:
- new instance of
ConvertOperators.ToDouble.
-
convertToInt
Creates newaggregation expressionfor$toIntthat converts a value to an int. Shorthand for#convertTo("int").
NOTE: Requires MongoDB 4.0 or later.- Returns:
- new instance of
ConvertOperators.ToInt.
-
convertToLong
Creates newaggregation expressionfor$toLongthat converts a value to a long. Shorthand for#convertTo("long").
NOTE: Requires MongoDB 4.0 or later.- Returns:
- new instance of
ConvertOperators.ToInt.
-
convertToObjectId
Creates newaggregation expressionfor$toObjectIdthat converts a value to a objectId. Shorthand for#convertTo("objectId").
NOTE: Requires MongoDB 4.0 or later.- Returns:
- new instance of
ConvertOperators.ToInt.
-
convertToString
Creates newaggregation expressionfor$toStringthat converts a value to a string. Shorthand for#convertTo("string").
NOTE: Requires MongoDB 4.0 or later.- Returns:
- new instance of
ConvertOperators.ToInt.
-
convertDegreesToRadians
AggregationExpressionfor$degreesToRadiansthat converts an input value measured in degrees to radians.- Returns:
- new instance of
ConvertOperators.DegreesToRadians. - Since:
- 3.3
-