PHPLIB-1634: Support encoding DateTimeInterface instances in aggregation builder#1610
Merged
alcaeus merged 7 commits intomongodb:v1.xfrom Feb 26, 2025
Merged
Conversation
alcaeus
commented
Feb 26, 2025
src/Builder/Stage.php
Outdated
| * @param QueryInterface|FieldQueryInterface|Type|stdClass|array<array-key, mixed>|bool|float|int|string|DateTimeInterface|null ...$queries The query predicates to match | ||
| */ | ||
| public static function match(QueryInterface|FieldQueryInterface|Type|stdClass|array|bool|float|int|string|null ...$queries): MatchStage | ||
| public static function match(QueryInterface|FieldQueryInterface|Type|stdClass|array|bool|float|int|string|DateTimeInterface|null ...$queries): MatchStage |
Member
Author
There was a problem hiding this comment.
This sent me on a short chase as I couldn't figure out why the match stage itself wasn't updated automatically. I forgot why we had to manually write this factory, but just leaving this here as a reminder for myself for the next time I have to make changes to the types accepted for $match.
ca19c38 to
71f7f5d
Compare
GromNaN
approved these changes
Feb 26, 2025
This was referenced Feb 26, 2025
Closed
Closed
Merged
GromNaN
pushed a commit
to GromNaN/mongo-php-library
that referenced
this pull request
Feb 23, 2026
…ion builder (mongodb#1610) * PHPLIB-1634: Support encoding DateTimeInterface instances in aggregation builder * Sort types correctly * Accept DateTimeInterface for query objects * Add missing psalm annotation * Use BSON Type class instead of UTCDateTime * Update psalm baseline
This file contains hidden or 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
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.
PHPLIB-1634
With a new encoder, we only need to add DateTimeInterface to be accepted for the
datetype, as well asany. In addition, the stage factory needs manual updating, as well as some return types in the expression encoders.