What is the difference between create, upsert and ...
# random
s
What is the difference between create, upsert and update? Do I understand it correctly that: •
create
requires an
id
since it will in any case create a new document or abort, if it already exists •
upsert
does not require an
id
but if it has one, and it exists, it replaces the existing record •
update
requires an
id
and only can update existing records Is that correct? So actually I can use
upsert
for all cases, and dynamically pass in
id
if I know it exists (eg update) or leave empty if I know its a new document (eg create).