Skip to content

Conversation

christophstrobl
Copy link
Member

@christophstrobl christophstrobl commented Sep 19, 2016

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");

should be back ported to 1.9.x and 1.8.x.

…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");
mp911de pushed a commit that referenced this pull request Sep 19, 2016
…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.
mp911de pushed a commit that referenced this pull request Sep 19, 2016
…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.
mp911de pushed a commit that referenced this pull request Sep 19, 2016
…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.
@mp911de mp911de closed this Sep 19, 2016
@mp911de mp911de self-assigned this Sep 19, 2016
@mp911de mp911de deleted the issue/DATAMONGO-1492 branch September 19, 2016 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants