Module spring.data.mongodb
Interface AggregationExpression
- All Superinterfaces:
MongoExpression
- All Known Implementing Classes:
AccumulatorOperators.Avg,AccumulatorOperators.CovariancePop,AccumulatorOperators.CovarianceSamp,AccumulatorOperators.ExpMovingAvg,AccumulatorOperators.Max,AccumulatorOperators.Median,AccumulatorOperators.Min,AccumulatorOperators.Percentile,AccumulatorOperators.StdDevPop,AccumulatorOperators.StdDevSamp,AccumulatorOperators.Sum,AggregationSpELExpression,ArithmeticOperators.Abs,ArithmeticOperators.ACos,ArithmeticOperators.ACosh,ArithmeticOperators.Add,ArithmeticOperators.ASin,ArithmeticOperators.ASinh,ArithmeticOperators.ATan,ArithmeticOperators.ATan2,ArithmeticOperators.ATanh,ArithmeticOperators.Ceil,ArithmeticOperators.Cos,ArithmeticOperators.Cosh,ArithmeticOperators.Derivative,ArithmeticOperators.Divide,ArithmeticOperators.Exp,ArithmeticOperators.Floor,ArithmeticOperators.Integral,ArithmeticOperators.Ln,ArithmeticOperators.Log,ArithmeticOperators.Log10,ArithmeticOperators.Mod,ArithmeticOperators.Multiply,ArithmeticOperators.Pow,ArithmeticOperators.Rand,ArithmeticOperators.Round,ArithmeticOperators.Sin,ArithmeticOperators.Sinh,ArithmeticOperators.Sqrt,ArithmeticOperators.Subtract,ArithmeticOperators.Tan,ArithmeticOperators.Tanh,ArithmeticOperators.Trunc,ArrayOperators.ArrayElemAt,ArrayOperators.ArrayToObject,ArrayOperators.ConcatArrays,ArrayOperators.Filter,ArrayOperators.First,ArrayOperators.In,ArrayOperators.IndexOfArray,ArrayOperators.IsArray,ArrayOperators.Last,ArrayOperators.RangeOperator,ArrayOperators.Reduce,ArrayOperators.Reduce.PropertyExpression,ArrayOperators.ReverseArray,ArrayOperators.Size,ArrayOperators.Slice,ArrayOperators.SortArray,ArrayOperators.Zip,BooleanOperators.And,BooleanOperators.Not,BooleanOperators.Or,BucketOperationSupport.OperationOutput,BucketOperationSupport.Output,BucketOperationSupport.Outputs,ComparisonOperators.Cmp,ComparisonOperators.Eq,ComparisonOperators.Gt,ComparisonOperators.Gte,ComparisonOperators.Lt,ComparisonOperators.Lte,ComparisonOperators.Ne,ConditionalOperators.Cond,ConditionalOperators.IfNull,ConditionalOperators.Switch,ConditionalOperators.Switch.CaseOperator,ConvertOperators.Convert,ConvertOperators.DegreesToRadians,ConvertOperators.ToBool,ConvertOperators.ToDate,ConvertOperators.ToDecimal,ConvertOperators.ToDouble,ConvertOperators.ToInt,ConvertOperators.ToLong,ConvertOperators.ToObjectId,ConvertOperators.ToString,DataTypeOperators.Type,DateOperators.DateAdd,DateOperators.DateDiff,DateOperators.DateFromParts,DateOperators.DateFromString,DateOperators.DateSubtract,DateOperators.DateToParts,DateOperators.DateToString,DateOperators.DateTrunc,DateOperators.DayOfMonth,DateOperators.DayOfWeek,DateOperators.DayOfYear,DateOperators.Hour,DateOperators.IsoDateFromParts,DateOperators.IsoDayOfWeek,DateOperators.IsoWeek,DateOperators.IsoWeekYear,DateOperators.Millisecond,DateOperators.Minute,DateOperators.Month,DateOperators.Second,DateOperators.TimezonedDateAggregationExpression,DateOperators.TsIncrement,DateOperators.TsSecond,DateOperators.Week,DateOperators.Year,DocumentOperators.DenseRank,DocumentOperators.DocumentNumber,DocumentOperators.Rank,DocumentOperators.Shift,EvaluationOperators.Expr,EvaluationOperators.LastObservationCarriedForward,LiteralOperators.Literal,ObjectOperators.GetField,ObjectOperators.MergeObjects,ObjectOperators.ObjectToArray,ObjectOperators.SetField,ScriptOperators.Accumulator,ScriptOperators.Function,SelectionOperators.Bottom,SelectionOperators.First,SelectionOperators.Last,SelectionOperators.Top,SetOperators.AllElementsTrue,SetOperators.AnyElementTrue,SetOperators.SetDifference,SetOperators.SetEquals,SetOperators.SetIntersection,SetOperators.SetIsSubset,SetOperators.SetUnion,StringOperators.Concat,StringOperators.IndexOfBytes,StringOperators.IndexOfCP,StringOperators.LTrim,StringOperators.RegexFind,StringOperators.RegexFindAll,StringOperators.RegexMatch,StringOperators.ReplaceAll,StringOperators.ReplaceOne,StringOperators.RTrim,StringOperators.Split,StringOperators.StrCaseCmp,StringOperators.StrLenBytes,StringOperators.StrLenCP,StringOperators.Substr,StringOperators.SubstrCP,StringOperators.ToLower,StringOperators.ToUpper,StringOperators.Trim,VariableOperators.Let,VariableOperators.Map
An
AggregationExpression can be used with field expressions in aggregation pipeline stages like
project and group.
The expressions toDocument(AggregationOperationContext) method is called during
the mapping process to obtain the mapped, ready to use representation that can be handed over to the driver as part
of an pipleine stage.
- Author:
- Thomas Darimont, Oliver Gierke, Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptionstatic AggregationExpressionfrom(MongoExpression expression) Create anAggregationExpressionout of a givenMongoExpressionto ensure the resultingDocumentis mapped against theAggregationOperationContext.default org.bson.DocumentObtain the as is (unmapped) representation of theAggregationExpression.org.bson.DocumenttoDocument(AggregationOperationContext context)
-
Method Details
-
from
Create anAggregationExpressionout of a givenMongoExpressionto ensure the resultingDocumentis mapped against theAggregationOperationContext.
If the given expression is already anAggregationExpressionthe very same instance is returned.- Parameters:
expression- must not be null.- Returns:
- never null.
- Since:
- 3.2
-
toDocument
default org.bson.Document toDocument()Obtain the as is (unmapped) representation of theAggregationExpression. UsetoDocument(AggregationOperationContext)with a matchingcontextto engage domain type mapping including field name resolution.- Specified by:
toDocumentin interfaceMongoExpression- Returns:
- never null.
- See Also:
-
toDocument
- Parameters:
context- must not be null.- Returns:
- the MongoDB native (
Document) form of the expression.
-