Document Update with arangoimp: ArangoDB Data Management
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
.
2 Comments
Leave a Comment
Get the latest tutorials, blog posts and news:
Hi There,
I have tried this method, but it doesn’t work for me.
It raise a error [1488] FATAL Wrong type ‘update’.
I am using the windows 7 and I have tried 3.0.0 and 3.0.4
Thanks
Hi mu,
this is a bug in 3.0.x, thanks for reporting. It is going to be fixed with the ArangoDB 3.0.6 Release.