mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-25 19:59:54 -05:00
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) BugFix ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) Yes ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Because of N-1 tests we can't update the sql UDF and start using it in documentdb at the same release. This 1 of 2 PRs to add the schema changes in release 0.101 and next PR will start using these UDF in documentdb in 0.102 Bug description: `bson_dollar_merge_documents` UDF today doesn't override nested arrays for projection with conflicting path and add the new projection entities inside each element of array which is not required in few places e.g. $lookup, $graphlookup etc ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request introduces a new function to handle mutating nested arrays in BSON documents. - Added `bson_dollar_merge_documents` function with an override flag in `bson_projection--0.101-0.sql`. - Implemented `MergeDocumentWithArrayOverride` function in `bson_project.c` to support the new feature. - Updated test cases in `bson_aggregation_stage_lookup_tests.sql` and corresponding expected output files. - Included the new SQL file in `documentdb--0.100-0--0.101-0.sql` and `pgmongo--1.24-0--1.101-0.sql`. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->