-
-
Notifications
You must be signed in to change notification settings - Fork 506
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
Introduce aggregation API to replicate query API #2211
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add UPGRADE-2.2.md already so we won't forget about it later :)
fb5835e
to
222334b
Compare
@malarzm updated UPGRADE documents and updated documentation. Mind giving it another look please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that's even more that I've asked for! 🎉
UPGRADE-3.0.md
Outdated
comparable to the `Query` class. | ||
|
||
The `Doctrine\ODM\MongoDB\Aggregation\Builder::execute()` method was deprecated | ||
and will be removed in ODM 3.0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In context of 3.0 this (and other sentences) should be written with the past tense I think :) But I have no problem with doing so in another PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was the original intention, but I goofed up. It's fixed now.
e777dcc
to
dc52f23
Compare
Thanks @alcaeus! |
Summary
This introduces a new
Aggregation
class, that can be created from an aggregation builder using thegetAggregation
method. Theexecute
method on the aggregation builder has been deprecated in favour of the new API.Rationale
The query builder returns a query instance that can be passed around without executing the query, but also disallowing changes to the query. The aggregation builder on the other hand only returns an iterator that may or may not have already executed something on the database. Passing the aggregation builder around opens it up to modification that may not be intended.