spring-data-mongodb icon indicating copy to clipboard operation
spring-data-mongodb copied to clipboard

Introduce AggregationStage API

Open christophstrobl opened this issue 2 years ago • 1 comments

This PR does two things

  • 1st we make sure to use available pipeline stages to figure out the operation in use to avoid running into an exception if toDocument does not return anything because toPipelineStages does.
  • 2nd new it introduces new API intended to replace AggregationOperation with AggregationStage that does not suffer the problem outlined in #4306 and moves us closer to MongoDB terminology, reducing cognitive overload. The default method arrangement also allowed to remove the deprecation warning within AggregationOperation.

christophstrobl avatar Mar 01 '23 09:03 christophstrobl

Introducing AggregationStage and a multi-document variant of that interface makes a lot of sense. In the light of our existing component it becomes obvious that we've mixed several concepts that are orthogonal (field-exposing operation that is a multi-document stage). We should revise our aggregation framework setup to let simple stages implement AggregationStage an decouple e.g. FieldsExposingAggregationOperation from AggregationStage.

mp911de avatar Mar 16 '23 14:03 mp911de