1
0
Fork 0

updated import manual

This commit is contained in:
Jan Steemann 2014-01-21 09:15:45 +01:00
parent 251c2fa448
commit 5001709926
5 changed files with 32 additions and 9 deletions

View File

@ -7,4 +7,4 @@ server: triagens GmbH High-Performance HTTP Server
connection: Keep-Alive
content-type: application/json; charset=utf-8
{"error":false,"created":2,"errors":0}
{"error":false,"created":2,"empty":0,"errors":0}

View File

@ -8,4 +8,4 @@ server: triagens GmbH High-Performance HTTP Server
connection: Keep-Alive
content-type: application/json; charset=utf-8
{"error":false,"created":2,"errors":0}
{"error":false,"created":2,"empty":0,"errors":0}

View File

@ -93,7 +93,14 @@ the data are line-wise JSON documents (type = documents) or a JSON list (type =
The server will respond with an HTTP 201 if everything went well. The number of
documents imported will be returned in the `created` attribute of the
response. If any documents were skipped or incorrectly formatted, this will be
returned in the `errors` attribute.
returned in the `errors` attribute. There will also be an attribute `empty` in
the response, which will contain a value of `0`.
If the `details` parameter was set to `true` in the request, the response will
also contain an attribute `details` which is a list of details about errors that
occurred on the server side during the import. This list might be empty if no
errors occurred.
Importing Headers and Values {#HttpImportHeaderData}
====================================================
@ -112,7 +119,13 @@ are needed or allowed in this data section.
The server will again respond with an HTTP 201 if everything went well. The
number of documents imported will be returned in the `created` attribute of the
response. If any documents were skipped or incorrectly formatted, this will be
returned in the `errors` attribute.
returned in the `errors` attribute. The number of empty lines in the input file
will be returned in the `empty` attribute.
If the `details` parameter was set to `true` in the request, the response will
also contain an attribute `details` which is a list of details about errors that
occurred on the server side during the import. This list might be empty if no
errors occurred.
Importing into Edge Collections {#HttpImportEdges}
==================================================

View File

@ -66,6 +66,18 @@ Please note that by default, _arangoimp_ will import data into the specified
collection in the default database (`_system`). To specify a different database,
use the `--server.database` option when invoking _arangoimp_.
An _arangoimp_ import will print out the final results on the command line.
By default, it shows the number of documents created, the number of errors that
occurred on the server side, and the total number of input file lines/documents
that it processed. Additionally, _arangoimp_ will print out details about errors
that happended on the server-side (if any).
Example:
created: 2
errors: 0
total: 2
Importing CSV Data {#ImpManualCsv}
==================================

View File

@ -244,14 +244,11 @@ int RestImportHandler::handleSingleDocument (ImportTransactionType& trx,
/// @RESTQUERYPARAM{type,string,required}
/// Determines how the body of the request will be interpreted. `type` can have
/// the following values:
///
/// - `documents`: when this type is used, each line in the request body is
/// expected to be an individual JSON-encoded document. Multiple JSON documents
/// in the request body need to be separated by newlines.
///
/// - `list`: when this type is used, the request body must contain a single
/// JSON-encoded list of individual documents to import.
///
/// - `auto`: if set, this will automatically determine the body type (either
/// `documents` or `list`).
///
@ -736,8 +733,9 @@ bool RestImportHandler::createFromJson (const string& type) {
///
/// @RESTBODYPARAM{documents,string,required}
/// The body must consist of JSON-encoded lists of attribute values, with one
/// line per per document. The first line of the request must be a JSON-encoded
/// list of attribute names.
/// line per per document. The first row of the request must be a JSON-encoded
/// list of attribute names. These attribute names are used for the data in the
/// subsequent rows.
///
/// @RESTQUERYPARAMETERS
///