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.

@FunctionalInterface public interface MongoExpression
Wrapper object for MongoDB expressions like $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 Details

    • create

      static MongoExpression create(String expression)
      Create a new MongoExpression from plain String (eg. $toUpper : $name).
      The given expression will be wrapped with { ... } to match an actual MongoDB Document if necessary.
      Parameters:
      expression - must not be null.
      Returns:
      new instance of MongoExpression.
    • create

      static MongoExpression create(String expression, Object... args)
      Create a new MongoExpression from plain String containing placeholders (eg. $toUpper : ?0) that will be resolved on first call of toDocument().
      The given expression will be wrapped with { ... } to match an actual MongoDB Document if necessary.
      Parameters:
      expression - must not be null.
      Returns:
      new instance of MongoExpression.
    • toDocument

      org.bson.Document toDocument()
      Obtain the native Document representation.
      Returns:
      never null.