Package org.springframework.data.mongodb
Interface MongoExpression
- All Known Subinterfaces:
AggregationExpression
- All Known Implementing Classes:
AccumulatorOperators.Avg,AccumulatorOperators.CovariancePop,AccumulatorOperators.CovarianceSamp,AccumulatorOperators.ExpMovingAvg,AccumulatorOperators.Max,AccumulatorOperators.Min,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,BindableMongoExpression,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
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Wrapper object for MongoDB expressions like
A set of predefined
$toUpper : $name that manifest as Document when
passed on to the driver.
A set of predefined
expressions, including a
SpEL based variant for method
like expressions (eg. toUpper(name)) are available via the
Aggregation API.- Since:
- 3.2
- Author:
- Christoph Strobl
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic MongoExpressionCreate a newMongoExpressionfrom plainString(eg.static MongoExpressionCreate a newMongoExpressionfrom plainStringcontaining placeholders (eg.org.bson.DocumentObtain the nativeDocumentrepresentation.
-
Method Details
-
create
Create a newMongoExpressionfrom plainString(eg.$toUpper : $name).
The given expression will be wrapped with{ ... }to match an actual MongoDBDocumentif necessary.- Parameters:
expression- must not be null.- Returns:
- new instance of
MongoExpression.
-
create
Create a newMongoExpressionfrom plainStringcontaining placeholders (eg.$toUpper : ?0) that will be resolved on first call oftoDocument().
The given expression will be wrapped with{ ... }to match an actual MongoDBDocumentif necessary.- Parameters:
expression- must not be null.- Returns:
- new instance of
MongoExpression.
-
toDocument
org.bson.Document toDocument()Obtain the nativeDocumentrepresentation.- Returns:
- never null.
-