### Does this PR have any customer impact? Yes
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No
### Are you introducing any new config? If yes, do you have tests with and without them being set? No
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
Implemented support for $degreesToRadians, $radiansToDegrees, $sin, $cos, $tan, $sinh, $cosh, $tanh, $asin, $acos, $atan, $atan2, $asinh, and $atanh trig operators
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request adds support for trigonometric operators in BSON expressions.
- Added trigonometric functions (`$sin`, `$cos`, `$tan`, `$sinh`, `$cosh`, `$tanh`, `$asin`, `$acos`, `$atan`, `$atan2`, `$asinh`, `$acosh`, `$atanh`) in `oss/pg_helio_api/src/operators/bson_expression_trigonometry_operators.c`.
- Added extensive test cases for the new trigonometric operators in `/pgmongo/src/test/regress/expected/bson_aggregation_trigonometric_operators_tests.out`.
### Does this PR have any customer impact?
Yes, it provides support for $changeStream pipeline stage for creating change stream cursor and consuming events from it.
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature.
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
Adds a new UDF for change_stream_aggregation
### Are you introducing any new config? If yes, do you have tests with and without them being set?
Adds a GUC for enabling ChangeStreams freature and tests have been added to test the feature. It is disabled by default.
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
../docs/pgmongo/design_docs/data_plane/change_streams/change_stream_release_notes.md
### Description
This PR implements the change stream tailing cursors using the direct WAL decoding. It avoids using replications slots for logical decoding because of the constraints in creating and decoding with replication slots.
Related work items: #2973720
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Perf
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
Yes
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
Support prepare for operations that have fixed args with feature flag off
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request introduces a new configuration option to skip the preparation of requests in the Postgres Mongo service.
- Added `SkipPrepare` property in `PostgresTenantConfiguration.cs` to read the new configuration.
- Updated `PostgresMongoRequestHandler.cs` to pass the `skipPrepare` flag to `PostgresRequestOptions`.
- Modified `PostgresRequestOptions.cs` to include the `SkipPrepare` flag.
- Added `pgmongo.skipPrepare` configuration in `pgmongo.c`.
- Updated `PostgresClient.cs` to conditionally call `PrepareAsync` based on the `SkipPrepare` flag.
### Does this PR have any customer impact?
Yes.
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature.
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
support DBRef in match
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request adds support for handling DBRef objects in query matching.
- `src/query/query_operator.c`: Added `CreateQualsForDBRef` function to handle DBRef fields (`$ref`, `$id`, `$db`) in queries.
- Modified `CreateQualsFromQueryDocIteratorInternal` to integrate the new DBRef handling logic.
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Perf
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
Yes (Feature flag for scan perf)
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
Enables joining across multiple RUM indexes for bitmap scans (so that the user doesn't need to create a single composite index for performance).
----
#### AI description (iteration 1)
#### PR Classification
Performance improvement
#### PR Summary
This pull request introduces optimized cross RUM index joins to enhance query performance.
- Added `rum_custom_join_scan.c` to implement custom scan logic for RUM index joins.
- Updated `rumget.c` to include `multiandgetbitmap` function for handling multiple index scans.
- Modified `custom_scan_continuation.c` to integrate custom scan paths and optimize query plans.
### Does this PR have any customer impact?
Yes
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature
### 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?
Yes and Yes
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
- Fix up bugs with $lookup with Let by rewriting lookup to be let friendly
- Get through jstests having lookup with let
- Optimize Lookup where hte left and right both are on _id to support joins directly on object_id
- Allow the lookup pipeline to be split as "inlined" and "non-inlined" and allow pushing up the inlined pipeline
- Fix bugs with facet/graphlookup arising from Lookup with let tests
- Allow inlining the $unwind path after a $lookup if the $unwind matches a $lookup as (behind a feature flag)
### 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?
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
Index truncation
----
#### AI description (iteration 1)
#### PR Classification
Bug fix to address incorrect data size calculation in index truncation.
#### PR Summary
This pull request corrects the data size calculation in the `TruncateNestedEntry` function to ensure accurate index truncation.
- `src/opclass/gin_index_term.c`: Adjusted `dataSize` calculation by adding `currentLength` to the base value.
### 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?
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
### Does this PR have any customer impact?
Yes
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature + BugFix
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
Yes, yes.
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
1. Supporting index term truncation for for nested objects (like arrays/objects or arrays/objects)
2. Fixing a release blocker bug that created wrong index term for single key wildcard index.
----
#### AI description (iteration 1)
#### PR Classification
New feature: Index term truncation for nested arrays and objects in BSON documents.
#### PR Summary
This pull request introduces functionality to truncate index terms for arrays of objects and nested objects/arrays in BSON documents to adhere to size limits.
- `oss/pg_helio_api/src/opclass/gin_index_term.c`: Added logic to handle truncation for `BSON_TYPE_DOCUMENT` and `BSON_TYPE_ARRAY` with specific size limits.
- `oss/pg_helio_core/src/io/pgbson.c`: Enhanced error messages to include specific BSON value types when values are too large to append.
### Does this PR have any customer impact?
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Bugfix
### 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?
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
bugfix for regex option validation
During $regex input spec we were not validating the options input by the user.
As per the jstest we need to throw error on invalid options.
hence, fixing that
Related work items: #1943161, #3335215
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
MongoDB doc:
https://www.mongodb.com/docs/manual/reference/operator/aggregation/getField/
### Does this PR have any customer impact?
Yes
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Bugfixes
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
1) Don't retry writes on replica clusterss
2) Don't allow $indexStats in transactions
3) Abort transaction on query failures (matches mongo/PG behavior)
4) Remove EnableExperimentalMultiCoordinator in GW, and remove old Version Greater checks.
----
#### AI description (iteration 1)
#### PR Classification
Code enhancement and new feature implementation.
#### PR Summary
This pull request introduces several enhancements and new features related to read replica handling and transaction management in the MongoDB Postgres integration.
- `ReadReplicaTests.cs`: Added integration tests to verify that writes to read replicas fail as expected.
- `ExtensionVersionExtensions.cs`: Removed version checks for deprecated backend versions.
- `PostgresTenantConfiguration.cs`: Added properties to handle read replica configurations.
- `PostgresMongoResultExtensions.cs`: Enhanced error handling for read-only transactions and replica clusters.
- `PostgresClient.cs`: Simplified index creation and dropping logic by removing multi-coordinator support.
### 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?
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
Support for Multiple variable in Let Lookup
----
#### AI description (iteration 1)
#### PR Classification
New feature: Support for multiple variables in `$lookup` stage of aggregation pipelines.
#### PR Summary
This pull request adds support for using multiple variables in the `$lookup` stage of MongoDB aggregation pipelines, enhancing query capabilities.
- `postgresjs/merge_stage_cx_scenario.js`: Added a new pipeline to test multiple variable support in `$lookup`.
- `bson_aggregation_pipeline_tests_let.out` and `bson_aggregation_pipeline_tests_let.sql`: Added test cases for multiple variable support in `$lookup`.
- `bson_aggregation_nested_pipeline.c`: Modified to handle multiple variables in `$lookup` and updated related functions.
- `LookupTests.cs`: Updated integration tests to validate the new feature and added setup/cleanup configurations.
- `utils.sh`: Enabled configuration settings for `let` support in aggregation stages.
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Devops
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
The last Citus 11 cluster was upgraded before July 5th. The next train therefore can go out with Just citus 12 support. Remove Citus 11 from the test matrix for jstests
### 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?
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
It will cause a jstest to fail.
jstest dev-container path: /home/cosmosdev/.nuget/packages/mongodb60.tests.internal.xcopy/1.0.2/content/6.0.5/jstests/core/ttl_index_options.js 25 line.
In Atlas, when creating a TTL index, if the input expireAfterSeconds is a floating point number, it will successfully create the index and only keep the integer part.
So there is no need to check whether the input expireAfterSeconds is a floating point number.

### 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?
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
pgmongo version update for 1.19 release - Round 2
### Does this PR have any customer impact?
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Bugfix
### 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?
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
For release we might need to discuss as there can be clients which are using this option.
### Description
This aims to fix the jstest "jstests/core/find_with_ntoreturn_fails.js"
This test states the option ntoreturn is not supported since mongo version>=5.1
hence, removing support
Related work items: #3336041
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
Plumb in the code for let with $lookup behind a feature flag
### 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)
NO
### Are you introducing any new config? If yes, do you have tests with and without them being set?
NO
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
when $push is missing 'each' but has other modifiers('position', 'slice', 'sort'), $push should treat those as plain fields and add to the specified array.
### Does this PR have any customer impact?
Not yet
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Features
### 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
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
Support remaining aggregation stages except $lookup and $mergeObjects on sorted with $group.
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Features
### 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
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
n/a
### Description
Add support for let in
- $sortByCount
- $group (partial)
- $addFields
- $project
- $facet
- $unionWith
- $graphLookup
- $project
Sets up syncing branches to internal repo for all new created branches
based on main.
* handles syncing new branches
* multiple commits
* syncing branches that were force pushed
* merge conflicts
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature
### 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
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
- Support for `$setWindowFields` aggregation pipeline stage
### Description
This PR adds the support for `$setWindowFields` aggregation stage using the Postgres `Window aggregation` operators.
For the first PR it only adds support with `$sum` aggregation operator.
Next set of PRs will individually support all the other window aggregation operators supported by `$setWindowFields` stage.
[TODO] Currently $sum is used as is (the way $group uses it), there is way to optimize this using the `Inverse Transition` functions for Window aggregation which modifies the aggregated state in a way to accomodate rows leaving the group in a moving window, which will be done later (this is done to make review on smaller set of files)
Related work items: #2272584
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature
### 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?
Yes
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
Add support for `let` in `find` and `aggregate`
- For find ensure that let can be supported both in projection and query.
- For aggregate, so far this is only supported in `$match`.
In subsequent PRs other stages will be reviewed and modified.
Note that this is a precursor to $lookup with let since Lookup's inner pipeline can reference any of those stages that can use `let`
Since this is a partial feature this is guarded with a feature flag.
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
- If we have 2 concurrent tables being created in 1 DB then they get colocated in 2 different groups.
- Prevent this by using a common table per db (system.dbSentinel).
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
No
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
support of `merge` Action in case of `whenMatched` in `$merge` aggregation stage.
Related work items: #1827100
### 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)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
disallow dots in group output field names, to make this test pssed: jstests\aggregation\bugs\server6198.js
### 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?
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
Adding a GUC for support for merge across DB.
After Latest colocation changes : https://msdata.visualstudio.com/CosmosDB/_git/pgmongo/pullrequest/1394549
For unsharded collections, if the source and target tables are in different databases, they will not be colocated. Additionally, unsharded collections no longer use HASH_DISTRIBUTION. As a result, Citus does not support the repartitioning strategy and the operation fails.
Currently, cross-database support is available under GUC until we have a fix in Citus.
### 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?
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
Add check that the geoNear query's reference point is within the geo bounds added in the index
Related work items: #3263902
### Does this PR have any customer impact?
yes
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Bugfix
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
no
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
For the bugbash found that we need to fix max depth for $lookup and $unionWith stages.
Enabled the jstest for the same