mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-25 19:59:54 -05:00
### Does this PR have any customer impact? ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) ### Are you introducing any new config? If yes, do you have tests with and without them being set? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Add support for nested regex in nin operator for composite index ---- #### AI description (iteration 1) #### PR Classification This pull request is a feature enhancement that adds support for nested regex patterns in the $nin operator for composite indexes. #### PR Summary The changes update the composite index code to correctly handle nested regex within the $nin operator by passing a new negation flag to various functions and adjusting bound calculations accordingly. Additionally, the pull request updates several expected output files and tests (both SQL and error/explain tests) to reflect the new behavior. - Updated `/oss/pg_documentdb/src/opclass/bson_gin_composite_core.c` functions (e.g. `SetSingleRangeBoundsFromStrategy`, `AddMultiBoundaryForDollarRegex`) to accept and act on a new `isNegationOp` flag for regex bounds. - Modified `/oss/pg_documentdb/include/query/bson_dollar_operators.h` to include an `isNegationOperator` field in the `RegexData` struct. - Revised test files (SQL scripts, expected output files in both distributed and pgmongo directories) to add and validate queries with regex patterns in both $in and $nin operators. - Adjusted several functions such as `ParseOperatorStrategy` and related boundary-setting functions to propagate the negation flag accurately. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->