-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Introduce AggregationStage API #4309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This commit makes sure to use available pipeline stages to figure out the operation.
With the introduction of AggregationStage we move the API closer to the MongoDB terminology removing kognitive overhead. Also the change allows us to switch back and forth with the default implementations of toDocument and toDocuments which let's us remove the deprecation warnings having dedicated interfaces that indicate what to implement in order to comply with the usage pattern.
3ea3118
to
38e4068
Compare
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
.
3ef872d
to
cd80c84
Compare
This PR does two things
toDocument
does not return anything becausetoPipelineStages
does.AggregationOperation
withAggregationStage
that does not suffer the problem outlined in AggregationOperation::toDocument method is deprecated, but MongoTemplate still uses it #4306 and moves us closer to MongoDB terminology, reducing cognitive overload. Thedefault
method arrangement also allowed to remove the deprecation warning withinAggregationOperation
.