-
-
Notifications
You must be signed in to change notification settings - Fork 504
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
Support new aggregation pipeline stages in builder #2513
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alcaeus
force-pushed
the
new-aggregation-stages
branch
from
March 17, 2023 10:16
6bcb6ca
to
e35e5d8
Compare
jmikola
reviewed
Mar 22, 2023
tests/Doctrine/ODM/MongoDB/Tests/Aggregation/Stage/MergeTest.php
Outdated
Show resolved
Hide resolved
tests/Doctrine/ODM/MongoDB/Tests/Aggregation/Stage/ReplaceWithTest.php
Outdated
Show resolved
Hide resolved
tests/Doctrine/ODM/MongoDB/Tests/Aggregation/Stage/UnsetTest.php
Outdated
Show resolved
Hide resolved
alcaeus
force-pushed
the
new-aggregation-stages
branch
from
March 23, 2023 12:25
b7deae2
to
67847c5
Compare
While adding types for things like |
jmikola
reviewed
Mar 23, 2023
tests/Doctrine/ODM/MongoDB/Tests/Aggregation/Stage/DensifyTest.php
Outdated
Show resolved
Hide resolved
alcaeus
force-pushed
the
new-aggregation-stages
branch
from
March 24, 2023 10:28
67ccc6b
to
385d344
Compare
jmikola
approved these changes
Mar 24, 2023
alcaeus
force-pushed
the
new-aggregation-stages
branch
from
March 24, 2023 13:51
385d344
to
ebcb32e
Compare
alcaeus
force-pushed
the
new-aggregation-stages
branch
from
March 24, 2023 13:53
ebcb32e
to
3596a4c
Compare
notrix
pushed a commit
to notrix/mongodb-odm
that referenced
this pull request
Apr 6, 2023
* Add $densify stage to aggregation pipeline builder * Add $fill stage to aggregation pipeline builder * Add $merge stage to aggregation pipeline builder * Add $replaceWith stage to aggregation pipeline builder * Add $set stage to aggregation pipeline builder * Add $unset stage to aggregation pipeline builder * Add $unionWith stage to aggregation pipeline builder * Use templates for Builder::addStage * Add template covariance error to psalm baseline * Remove unnecessary abstraction for $addFields and $set * Use array_fields for lists in variadic arguments * Improve wording when field name is required in Expr classes * Add missing type to whenMatched option * Update type for let option * Use ? syntax for nullable type * Rename test methods to hide copy/paste * Test all range options for $densify * Test complex values and sort for $fill * Test reusing same builder for $merge * Simplify creation of UTCDateTime instances in tests * Allow expressions as partition in $fill stage * Define psalm types for most pipeline stages * Improve handling of required options as typed arguments
alcaeus
added a commit
that referenced
this pull request
Apr 11, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This pull requests adds a number of previously unsupported aggregation pipeline stages to the builder:
$densify
$fill
$merge
$replaceWith
$set
$unset
$unionWith
It also leverages templates to allow
Builder::addStage
to indicate that it's returning the exact stage that was given, simplifying code in the Builder class.This leaves the
$search
,$searchMeta
, and$setWindowFields
stages left to be implemented. I'll create separate pull requests for those due to their complexity (especially$search
). I'll also have a separate pull request to support new pipeline operators.