Skip to content

Conversation

@alcaeus
Copy link
Member

@alcaeus alcaeus commented Nov 3, 2025

PHPLIB-1699

This adds missing encoding of builder pipelines when passed as an update to findAndModify operations.

@alcaeus alcaeus requested a review from a team as a code owner November 3, 2025 12:36
@alcaeus alcaeus requested review from GromNaN and Copilot November 3, 2025 12:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for builder pipelines in the findOneAndUpdate method by ensuring that builder objects passed as the update parameter are properly encoded. Previously, only the filter parameter was being encoded through the builder encoder.

Key Changes

  • Added encoding support for the update parameter in findOneAndUpdate method
  • Added test coverage for findOneAndUpdate with pipeline updates

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Collection.php Added builder encoding for the update parameter in findOneAndUpdate method
tests/Collection/BuilderCollectionFunctionalTest.php Added test case to verify pipeline updates work correctly with findOneAndUpdate

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too easy. I'm sure you did it on your phone?

@alcaeus
Copy link
Member Author

alcaeus commented Nov 3, 2025

I'm sure you did it on your phone?

Could have, but I can't authenticate as MongoDB employee from my phone.

@alcaeus alcaeus enabled auto-merge (squash) November 3, 2025 12:38
@codecov-commenter
Copy link

codecov-commenter commented Nov 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.72%. Comparing base (b25b5d0) to head (74e8fad).
⚠️ Report is 2 commits behind head on v2.x.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##               v2.x    #1793      +/-   ##
============================================
- Coverage     87.74%   87.72%   -0.02%     
  Complexity     3195     3195              
============================================
  Files           424      424              
  Lines          6354     6296      -58     
============================================
- Hits           5575     5523      -52     
+ Misses          779      773       -6     
Flag Coverage Δ
6.0-replica_set 85.70% <100.00%> (+0.01%) ⬆️
6.0-server 81.70% <100.00%> (-0.01%) ⬇️
6.0-sharded_cluster 85.29% <100.00%> (+<0.01%) ⬆️
8.0-replica_set 87.64% <100.00%> (-0.02%) ⬇️
8.0-server 82.54% <100.00%> (-0.05%) ⬇️
8.0-sharded_cluster 87.30% <100.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alcaeus alcaeus merged commit 75fa63e into mongodb:v2.x Nov 3, 2025
33 checks passed
@alcaeus alcaeus deleted the phplib-1699-support-pipeline-find-and-modify branch November 3, 2025 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants