Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PHPORM-155 Fluent aggregation builder #2738
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
PHPORM-155 Fluent aggregation builder #2738
Changes from all commits
8a982fd
b1696f4
e247fe6
f9a44f0
6ad5a56
706365f
5b3d1cc
19542dd
ef935d7
4aba26d
55f05f4
ec251c7
cbd6284
363de83
f6b207c
4f0894f
a30d529
28ab37f
defb21f
8ebd6bb
8a0937e
a3ec4a4
554a1d7
d9a3273
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Allows completions such as
Model::where()->aggregate()->addField(
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.
Is there any reason to allow
MongoDB\Collection
here? It's only constructed as such in the test suite, but I presume you could just mockMongoDB\Laravel\Collection
instead there.I do realize
MongoDB\Laravel\Collection
just forwards method calls to the PHPLIB class, so there's no technical reason that aMongoDB\Collection
wouldn't work as well.OK to leave as-is. I just wanted to bring this up since it makes the API more permissive and I don't expect users would be constructing this on their own anyway.
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.
I expect
MongoDB\Laravel\Collection
to be deprecated soon, as it's used only for logging commands. We need to switch to driver monitoring features: PHPORM-56. This union type is forward-compatible.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.
I was concerned of potential conflict with a stage name, but
$first
is an expression operator 😅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.
Even though this is internal, I suppose you can't use
MongoDB\Driver\Cursor
here since a CodecCursor might be returned?Unrelated to this PR, but this made me wonder if we need to keep
CursorInterface&Iterator
in place in PHPLIB 2.0, or if there were plans to integrate the Iterator API into CursorInterface. I asked @alcaeus about this in PHPLIB-1114.Nothing for you here. I merely wanted to cross-reference.