You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DATAMONGO-1492 - Make o.s.d.m.core.aggregation.AggregationExpression public.
By turning `AggregationExpression` public we allow adding custom expressions without workarounds. It is now possible to create eg. `ProjectionOperation` like:
ProjectionOperation agg = Aggregation.project()
.and(new AggregationExpression() {
@OverRide
public DBObject toDbObject(AggregationOperationContext context) {
DBObject filterExpression = new BasicDBObject();
filterExpression.put("input", "$x");
filterExpression.put("as", "y");
filterExpression.put("cond", new BasicDBObject("$eq", Arrays.<Object> asList("$$y.z", 2)));
return new BasicDBObject("$filter", filterExpression);
}
}).as("profile");
Original pull request: #392.
Copy file name to clipboardExpand all lines: spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationExpression.java
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2015 the original author or authors.
2
+
* Copyright 2015-2016 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -20,16 +20,17 @@
20
20
/**
21
21
* An {@link AggregationExpression} can be used with field expressions in aggregation pipeline stages like
22
22
* {@code project} and {@code group}.
23
-
*
23
+
*
24
24
* @author Thomas Darimont
25
25
* @author Oliver Gierke
26
+
* @author Christoph Strobl
26
27
*/
27
-
interfaceAggregationExpression {
28
+
publicinterfaceAggregationExpression {
28
29
29
30
/**
30
31
* Turns the {@link AggregationExpression} into a {@link DBObject} within the given
0 commit comments