Skip to content

Update AggregationTests.filterShouldBeAppliedCorrectly to use non-deprecated method [DATAMONGO-1606] #2516

@spring-projects-issues

Description

@spring-projects-issues

Amy Aldredge opened DATAMONGO-1606 and commented

Trying to figure out the correct syntax for aggregation framework project filter using AggregationExpression over the deprecated AggregationFunctionExpressions is difficult without an example.

The following seems to be the correct syntax to do the equivalent operation (line 1503/1504)

TypedAggregation<Sales> agg = newAggregation(Sales.class, project().and("items")
				.filter("item", ComparisonOperators.Gte.valueOf("item.price").greaterThanEqualToValue(100)).as("items"));

Affects: 1.10 GA (Ingalls)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions