Skip to main content

arangoimport

arangoimport is a client utility which allows you to import json, jsonl and csv files into arangodb. The files can be created manually, exported from other systems, or created using the arangoexport tool using another arangodb instance

Importing data

tip

Please replace the content in <> with your deployment specific information

  • If you are using ArangoGraph the port is typically 18529 and NOT 8529; 8529 is only used for the WebUI for ArangoGraph
  • If you are using a manual deployment the port is typically 8529 or whatever specific port you configured with port mapping (docker/k8s)
  1. Use the following syntax to import the airports data (Official documentation for reference):

    arangoimport  --server.endpoint <protocol>://<hostname>:<port> \
    --server.database travel \
    --collection airports \
    --server.username <username> \
    --type json --file <data file>

    Example:

    arangoimport  --server.endpoint http+ssl://54a63d5bf946.arangodb.cloud:18529 --server.database travel --server.username 'root' --collection airports --type json --file ~/Downloads/travel/airports.json
    Please specify a password:
    Connected to ArangoDB 'http+ssl://54a63d5bf946.arangodb.cloud:18529, version: 3.10.9, database: 'travel', username: 'root'
    ----------------------------------------
    database: travel
    collection: airports
    overwrite coll. prefix: no
    create: no
    create database: no
    source filename: /Users/asifkazi/Downloads/travel/airports.json
    file type: json
    threads: 12
    on duplicate: error
    connect timeout: 5
    request timeout: 1200
    ----------------------------------------
    Starting JSON import...
    2023-08-15T01:24:34Z [48486] INFO [9ddf3] {general} processed 608.8 KB (3%) of input file
  2. Please enter the password for the user when prompted. If the command is successful, you should see a summary of the imported airports data

    created:          3375
    warnings/errors: 0
    updated/replaced: 0
    ignored: 0
  3. Use the following command to import the flights data:

    arangoimport  --server.endpoint <protocol>://<hostname>:<port> \
    --server.database travel \
    --collection flights \
    --server.username <username> \
    --type json --file <data file>
    --batch-size 100000000

    Example:

    arangoimport  --server.endpoint http+ssl://54a63d5bf946.arangodb.cloud:18529 --server.database travel --server.username 'root' --collection flights --type json --file ~/Downloads/travel/flights.json --batch-size 100000000
    Please specify a password:
    Connected to ArangoDB 'http+ssl://54a63d5bf946.arangodb.cloud:18529, version: 3.10.9, database: 'travel', username: 'root'
    ----------------------------------------
    database: travel
    collection: flights
    overwrite coll. prefix: no
    create: no
    create database: no
    source filename: /Users/asifkazi/Downloads/travel/flights.json
    file type: json
    threads: 12
    on duplicate: error
    connect timeout: 5
    request timeout: 1200
    ----------------------------------------
    Starting JSON import...
    2023-08-15T00:48:18Z [39237] INFO [9ddf3] {general} processed 3.1 MB (3%) of input file
    2023-08-15T00:48:18Z [39237] INFO [9ddf3] {general} processed 6.2 MB (6%) of input file
    2023-08-15T00:48:18Z [39237] INFO [9ddf3] {general} processed 9.4 MB (9%) of input file
  4. Please enter the password for the user when prompted. If the command is successful, you should see a summary of the imported flights data

    created:          286463
    warnings/errors: 0
    updated/replaced: 0
    ignored: 0

Congratulations! Your data is now uploaded and ready to use

 
Help us improve

Anything unclear or buggy in this tutorial? Provide Feedback