Hacker News new | ask | show | jobs
by eggn00dles 334 days ago
append or extend is adding keys without updating existing keys. update can add keys and update existing keys.

put will blow away existing keys if they dont exist in the new payload. which is why it cant be upsert.

1 comments

... it depends on how the given server defines PUT of course (also how we define upsert, and does upsert make sense outside a DB setting? well, of course some DBs have a HTTP/ReST API.)

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