home shape

Upsert Operations in ArangoDB: Efficient Data Management

This week saw the completion of the AQL UPSERT command. This command will be very helpful in a lot of use cases, including the following:

  • ensure that a document exists
  • update a document if it exists, otherwise create it
  • replace a document if it exists, otherwise create it

The UPSERT command is executed on the server side and so delivers client applications from issuing a fetch command followed by a separate, conditional UPDATE or INSERT command.

The general format of an UPSERT statement is:

UPSERT search-document
INSERT insert-expression
UPDATE update-expression
IN collection-name

Jan collected a few example invocations of UPSERT in his blog.

Ingo

Ingo Friepoertner

Ingo is dealing with all the good ideas from the ArangoDB community, customers and industry experts to improve the value provided by the company’s native multi-model approach. In former positions he worked as a product owner and tech consultant, building custom software solutions for large companies in various industries. Ingo holds a diploma in business informatics from FHDW University of Applied Sciences.

Leave a Comment





Get the latest tutorials, blog posts and news: