1
0
Fork 0
Commit Graph

23 Commits

Author SHA1 Message Date
Jan Steemann 92fcdd3e56 issue #1298: Bulk import if data already exists
This change extends the HTTP REST API for bulk imports as follows:

When documents are imported and the `_key` attribute is specified for them, the import can be
used for inserting and updating/replacing documents. Previously, the import could be used for
inserting new documents only, and re-inserting a document with an existing would have failed
with a *unique key constraint violated* error.

The above behavior is still the default. However, the API now allows controlling the behavior
in case of a unique key constraint error via the optional URL parameter `onDuplicate`.

This parameter can have one of the following values:

- `error`: when a unique key constraint error occurs, do not import or update the document but
  report an error. This is the default.

- `update`: when a unique key constraint error occurs, try to (partially) update the existing
  document with the data specified in the import. This may still fail if the document would
  violate secondary unique indexes. Only the attributes present in the import data will be
  updated and other attributes already present will be preserved. The number of updated documents
  will be reported in the `updated` attribute of the HTTP API result.

- `replace`: when a unique key constraint error occurs, try to fully replace the existing
  document with the data specified in the import. This may still fail if the document would
  violate secondary unique indexes. The number of replaced documents will be reported in the
  `updated` attribute of the HTTP API result.

- `ignore`: when a unique key constraint error occurs, ignore this error. There will be no
  insert, update or replace for the particular document. Ignored documents will be reported
  separately in the `ignored` attribute of the HTTP API result.

The result of the HTTP import API will now contain the attributes `ignored` and `updated`, which
contain the number of ignored and updated documents respectively. These attributes will contain a
value of zero unless the `onDuplicate` URL parameter is set to either `update` or `replace`
(in this case the `updated` attribute may contain non-zero values) or `ignore` (in this case the
`ignored` attribute may contain a non-zero value).
2015-04-14 11:44:33 +02:00
Jan Steemann 2299d2916d initial commit to satisfy #1298 2015-04-13 18:26:33 +02:00
Jan Steemann 20e7fe7a7a the great rename: array => object, list => array 2014-12-18 21:07:06 +01:00
Jan Steemann 13d240384f less namespace pollution 2014-10-28 00:24:37 +01:00
Jan Steemann ce9499eac8 less string copying, less regex slowdown when importing CSV files 2014-09-30 23:20:12 +02:00
Jan Steemann 669cb3b235 renamed files 2014-09-13 01:44:01 +02:00
Jan Steemann 87afcf5e8d the great rename 2014-09-13 00:10:11 +02:00
Jan Steemann d72354da66 issue #1003: added feature to use backslash escaping for CSV data in arangoimp 2014-08-28 21:03:58 +02:00
Frank Celler 4dcf5dc817 updated disclaimer 2014-06-20 16:40:35 +02:00
Jan Steemann b811d21fad issue #862: added `--overwrite` option for arangoimp 2014-05-16 21:29:20 +02:00
Frank Celler 1aa5109fa3 updated disclaimer 2013-03-13 17:03:18 +01:00
Jan Steemann ebc653a0bd issue #435 2013-02-26 12:11:13 +01:00
Frank Celler 2553b572ab fixed mode 2013-02-21 14:14:20 +01:00
Jan Steemann 4e5a9e0f4e windows is not GNU 2013-01-22 18:06:34 +01:00
Jan Steemann 7254487e14 added --progress option for arangoimp. make arangod show import errors 2013-01-22 15:04:06 +01:00
Frank Celler 7380ddfabe Merge branch '1.1' of github.com:triAGENS/ArangoDB into devel
Conflicts:
	arangosh/V8Client/arangosh.cpp
	bin/arango32.msi
	bin/arango64.msi
	lib/BasicsC/win-utils.c
2013-01-15 15:50:47 +01:00
Oreste Panaia c01a5c6275 arango shell and import 2013-01-14 20:16:09 +08:00
Jan Steemann d562c52fd7 backport of issue #300 2012-12-22 03:38:29 +01:00
Jan Steemann 8c7ca55512 issue #300 2012-12-01 03:15:39 +01:00
Jan Steemann 3b5d4a4fc9 issue #204: allow import of tab-separated values
this enables the user to specify the tab as separator for arangoimp.
the separator and eol values used by arangoimp can now also consist of
more than one character.

updated documentation and added test cases
2012-09-30 01:38:32 +02:00
Frank Celler 35fa7aee93 fixed subdirectory build 2012-08-19 22:38:16 +02:00
Jan Steemann 5a74e95f35 allow reusing ids and revision when creating collections and documents 2012-06-19 15:50:52 +02:00
Frank Celler d2c758d663 the great rename 2012-06-08 15:01:25 +02:00