Skip to content

DRIVERS-3235 Support regex in $replaceOne find argument#49

Merged
GromNaN merged 2 commits into
mongodb:mainfrom
GromNaN:PHPLIB-1818-replaceOne-regex
Jun 15, 2026
Merged

DRIVERS-3235 Support regex in $replaceOne find argument#49
GromNaN merged 2 commits into
mongodb:mainfrom
GromNaN:PHPLIB-1818-replaceOne-regex

Conversation

@GromNaN

@GromNaN GromNaN commented Jun 15, 2026

Copy link
Copy Markdown
Member

Add resolvesToRegex to the find argument of $replaceOne, mirroring the existing support in $replaceAll.

This also adds a "Replace Using Regex" test case consistent with the one in replaceAll.yaml.

Refs:

Copilot AI review requested due to automatic review settings June 15, 2026 09:32

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

Updates the $replaceOne operator specification to allow regex patterns for the find argument (parity with $replaceAll) and adds a corresponding regex-based example test case.

Changes:

  • Added resolvesToRegex to $replaceOne.find argument types.
  • Added a “Replace Using Regex” pipeline+schema test mirroring $replaceAll’s regex example.

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

Comment thread definitions/expression/replaceOne.yaml Outdated
Copilot AI review requested due to automatic review settings June 15, 2026 10:18
@GromNaN GromNaN requested a review from paulinevos June 15, 2026 10:19

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

@GromNaN GromNaN changed the title Support regex in $replaceOne find argument DRIVERS-3235 Support regex in $replaceOne find argument Jun 15, 2026
@GromNaN GromNaN force-pushed the PHPLIB-1818-replaceOne-regex branch from a699d98 to 4aacd0e Compare June 15, 2026 11:33
@GromNaN GromNaN merged commit d23e9a8 into mongodb:main Jun 15, 2026
3 checks passed
@GromNaN GromNaN deleted the PHPLIB-1818-replaceOne-regex branch June 15, 2026 12:28
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