Skip to content

PHPLIB-1735 Implement returnStoredSource in $vectorSearch#1896

Merged
GromNaN merged 2 commits into
mongodb:v2.xfrom
paulinevos:stored-source
May 22, 2026
Merged

PHPLIB-1735 Implement returnStoredSource in $vectorSearch#1896
GromNaN merged 2 commits into
mongodb:v2.xfrom
paulinevos:stored-source

Conversation

@paulinevos
Copy link
Copy Markdown
Contributor

@paulinevos paulinevos commented May 8, 2026

Copilot AI review requested due to automatic review settings May 8, 2026 12:09
@paulinevos paulinevos requested a review from a team as a code owner May 8, 2026 12:09
@paulinevos paulinevos requested a review from GromNaN May 8, 2026 12:09
Copy link
Copy Markdown
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

Implements support for the returnStoredSource option on the $vectorSearch aggregation stage within the PHP builder, aligning stage construction and encoding with the updated spec and adding coverage for the new option.

Changes:

  • Added returnStoredSource as an optional boolean argument/property for $vectorSearch stage encoding.
  • Updated the stage factory and fluent factory helpers to accept/pass through returnStoredSource.
  • Added a new pipeline fixture and test case validating returnStoredSource: true output.

Reviewed changes

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

Show a summary per file
File Description
tests/Builder/Stage/VectorSearchStageTest.php Adds a new test covering $vectorSearch with returnStoredSource: true.
tests/Builder/Stage/Pipelines.php Updates vector search doc links and adds a stored-source pipeline fixture.
src/Builder/Stage/VectorSearchStage.php Extends the stage operator to include and serialize returnStoredSource.
src/Builder/Stage/FluentFactoryTrait.php Adds returnStoredSource to the fluent vectorSearch() helper and forwards it.
src/Builder/Stage/FactoryTrait.php Adds returnStoredSource to the static vectorSearch() factory and forwards it.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 8, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 87.72%. Comparing base (d4306b2) to head (9281eac).
⚠️ Report is 1 commits behind head on v2.x.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/Builder/Stage/FluentFactoryTrait.php 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               v2.x    #1896   +/-   ##
=========================================
  Coverage     87.72%   87.72%           
  Complexity     3328     3328           
=========================================
  Files           454      454           
  Lines          6656     6657    +1     
=========================================
+ Hits           5839     5840    +1     
  Misses          817      817           
Flag Coverage Δ
6.0-replica_set 86.57% <66.66%> (+<0.01%) ⬆️
6.0-server 82.61% <66.66%> (+<0.01%) ⬆️
6.0-sharded_cluster 86.36% <66.66%> (+<0.01%) ⬆️
8.0-replica_set 87.59% <66.66%> (+<0.01%) ⬆️
8.0-server 83.35% <66.66%> (+<0.01%) ⬆️
8.0-sharded_cluster ?

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.

@GromNaN GromNaN changed the title DRIVERS-3300: Implement returnStoredSource in $vectorSearch PHPLIB-1763 Implement returnStoredSource in $vectorSearch May 20, 2026
@GromNaN GromNaN enabled auto-merge (squash) May 20, 2026 13:16
@GromNaN GromNaN changed the title PHPLIB-1763 Implement returnStoredSource in $vectorSearch PHPLIB-1735 Implement returnStoredSource in $vectorSearch May 20, 2026
@GromNaN GromNaN disabled auto-merge May 20, 2026 13:17
@GromNaN GromNaN enabled auto-merge (squash) May 20, 2026 13:17
Copilot AI review requested due to automatic review settings May 20, 2026 13:25
Copy link
Copy Markdown
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

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

@GromNaN GromNaN merged commit f1b5d59 into mongodb:v2.x May 22, 2026
34 of 35 checks passed
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.

4 participants