Skip to content

PHPLIB-1733: Support nested fields in vectorSearch#1912

Merged
paulinevos merged 1 commit into
mongodb:v2.xfrom
paulinevos:nested-fields
Jun 9, 2026
Merged

PHPLIB-1733: Support nested fields in vectorSearch#1912
paulinevos merged 1 commit into
mongodb:v2.xfrom
paulinevos:nested-fields

Conversation

@paulinevos

Copy link
Copy Markdown
Contributor

Part of DRIVERS-3308

@paulinevos paulinevos requested a review from a team as a code owner June 1, 2026 15:04
@paulinevos paulinevos requested review from GromNaN and Copilot June 1, 2026 15:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 extends the aggregation builder’s $vectorSearch stage support to cover Atlas Vector Search nested-field use cases by adding support for parentFilter and nestedOptions, along with a new pipeline fixture and test to validate canonical Extended JSON output.

Changes:

  • Added parentFilter and nestedOptions support to the vectorSearch stage builder and fluent pipeline API.
  • Added a new test case and corresponding canonical JSON fixture for a nested-field $vectorSearch example.
  • Minor test refactor to use named-argument ordering consistently (e.g., limit moved earlier in one call).

Reviewed changes

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

Show a summary per file
File Description
tests/Builder/Stage/VectorSearchStageTest.php Adds a nested-field $vectorSearch test using parentFilter and nestedOptions.
tests/Builder/Stage/Pipelines.php Adds canonical Extended JSON fixture for the nested-field $vectorSearch pipeline.
src/Builder/Stage/VectorSearchStage.php Adds new properties/constructor args and array-to-QueryObject conversion for parentFilter.
src/Builder/Stage/FluentFactoryTrait.php Extends fluent vectorSearch() wrapper to accept the new options.
src/Builder/Stage/FactoryTrait.php Extends static vectorSearch() factory to accept the new options.

Comment thread src/Builder/Stage/FactoryTrait.php Outdated
Comment thread src/Builder/Stage/FluentFactoryTrait.php
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Builder/Stage/FluentFactoryTrait.php 0.00% 1 Missing ⚠️
src/Builder/Stage/VectorSearchStage.php 75.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copilot AI review requested due to automatic review settings June 2, 2026 09:46
Comment thread src/Builder/Stage/VectorSearchStage.php Dismissed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 7 out of 7 changed files in this pull request and generated no new comments.

@paulinevos paulinevos requested a review from kevinAlbs June 5, 2026 10:20
Comment thread tests/Builder/Stage/VectorSearchStageTest.php Outdated
@paulinevos paulinevos enabled auto-merge (squash) June 8, 2026 10:53
Copilot AI review requested due to automatic review settings June 8, 2026 14:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 7 out of 7 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings June 9, 2026 12:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 7 out of 7 changed files in this pull request and generated no new comments.

@paulinevos paulinevos merged commit 5a3ee32 into mongodb:v2.x Jun 9, 2026
36 checks passed
@paulinevos paulinevos deleted the nested-fields branch June 9, 2026 12:39
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.

6 participants