public class AggregationSpELExpression extends Object implements AggregationExpression
AggregationExpression that renders a MongoDB Aggregation Framework expression from the AST of a
SpEL
expression.
// { $and: [ { $gt: [ "$qty", 100 ] }, { $lt: [ "$qty", 250 ] } ] }
expressionOf("qty > 100 && qty < 250);
// { $cond : { if : { $gte : [ "$a", 42 ]}, then : "answer", else : "no-answer" } }
expressionOf("cond(a >= 42, 'answer', 'no-answer')");
SpelExpressionTransformer| Modifier and Type | Method and Description |
|---|---|
static AggregationSpELExpression |
expressionOf(String expressionString,
Object... parameters)
Creates new
AggregationSpELExpression for the given expressionString and parameters. |
org.bson.Document |
toDocument(AggregationOperationContext context)
|
public static AggregationSpELExpression expressionOf(String expressionString, Object... parameters)
AggregationSpELExpression for the given expressionString and parameters.expressionString - must not be null.parameters - can be empty.public org.bson.Document toDocument(AggregationOperationContext context)
AggregationExpressiontoDocument in interface AggregationExpressionCopyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.