Tôi có một hàm nhận Aggregation aggregation
làm thông số.Spring Mongo> Cách lấy danh sách AggregationOperations from Aggregation
Tôi muốn nhận tất cả AggregationOperation
từ aggregation
. Có cách nào để làm điều đó?
public Aggregation newCustomAggregation(Aggregation aggregation, Criteria c) {
// How to get list operation aggregation there?
listOperation.push(Aggregation.match(c));
return Aggregation
.newAggregation(listOperations);
}
Mục đích của tôi là mới khác Aggregation
với tùy chỉnh của tôi MatchAggregation
.
Làm thế nào để bạn có kế hoạch sử dụng này 'newCustomAggregation' chức năng? – chridam
Xin chào chridam, tôi muốn sử dụng nó để thêm tiêu chí động để lọc ra kết quả khi nhận nó như một tham số (tương tự như cách query.addCriteria (... myCriteria)) –