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 When using mongodb-driver-sync 4.0.6, and performing a query, the namespace in the request looks like "<db>.$cmd" compared to other version where it is "admin.$cmd". To accommodate this version, we just check if the collection name equals $cmd which is similar to what we do in the other Gateway ---- #### AI description (iteration 1) #### PR Classification This PR implements an API update and bug fix to correctly handle OP_QUERY messages for Java driver 4.0.6. #### PR Summary The pull request refines the query parsing logic by extracting the collection name from the namespace instead of using the full collection path, ensuring that command queries are accurately identified and unsupported queries are logged. - In `oss/pg_documentdb_gw/src/protocol/reader.rs`, the code now extracts a tuple (_db, collection_name) from the namespace. - The condition to detect command messages is simplified to check if `collection_name` equals "$cmd". - An informational log is added to print the collection name when OP_QUERY is unsupported. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->