mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-25 11:49:53 -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) 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 Fix up update to only do upsert if the query was exactly on _id. other cases should defer to insert (and fail on unique conflict) ---- #### AI description (iteration 1) #### PR Classification Bug fix to ensure upsert operations are only performed when the query is on `_id`. #### PR Summary This pull request modifies the upsert logic to only perform upserts if the query is solely based on the `_id` field. - Updated `update.c` to check for queries with only `_id` filters and renamed related variables for clarity. - Added test cases in `commands_update.out` and `commands_update.sql` to verify upsert behavior and handle error cases.