If a function can both insert and update, it should be called "put". Using "update" is misleading.
If a function can both insert and update, it should be called "put". Using "update" is misleading.
(New startup pitch: Our agentic AI scans your access and error logs, and automatically vibe codes new API endpoints for failed API calls and pushes them to production within seconds, all without expensive developers or human intervention! Please form an orderly queue with your termsheets and Angel Investment cheques.)
It might actually work if the subscription is expensive enough.
upsert is for you insert/update.
semantically PUT is exactly upsert.
upsert is update + create if not exists, which is exactly PUT
any update without overwrite is "append" or "extend" (or something else)
put will blow away existing keys if they dont exist in the new payload. which is why it cant be upsert.
that said, usually PUT is meaningful for a URL (or URI), and in these circumstances it's like upsert, and it cannot blow away other keys, as it operates on one key, given by the URL
of course if we assume a batch endpoint, sure, it then can do non-upsert-like things