Updating Documents with an Arangoimp Import
Tags: Documentation, Performance
Estimated reading time: 1 minutes
Inspired by the feature request in Github issue #1298, we added update and replace support for ArangoDB’s import facilities.
This extends ArangoDB’s HTTP REST API for importing documents plus the arangoimp binary so they can not only insert new documents but also update existing ones.
Inserts and updates can also be mixed in a single import run. What exactly will happen is configurable by setting arangoimp’s new command-line option --on-duplicate.
By default, error will be reported if a document already exists. This behavior can be changed by setting --on-duplicate to a value of update, replace or ignore. Here is an example result of an import with duplicated keys:
> arangoimp --file data.json --collection users --on-duplicate update
created: 1
warnings/errors: 0
updated/replaced: 2
ignored: 0
So, if you want to aggregate data from several data files, you can try the new import command-line option --on-duplicate.

Leave a Comment