Exporting Data from an ArangoDB database

    This exports the collections test into the directory dump as one big json array. Every entryin this array is one document from the collection without a specific order. To export more thanone collection at a time specify multiple —collection options.

    The default output directory is export.

    arangoexport will by default connect to the _system database using the defaultendpoint. If you want to connect to a different database or a different endpoint, or use authentication, you can use the following command-line options:

    • —server.database : name of the database to connect to
    • —server.endpoint : endpoint to connect to
    • —server.password : password to use (omit this and you'll be prompted for thepassword)
    • —server.authentication : whether or not to use authenticationHere’s an example of exporting data from a non-standard endpoint, using a dedicateddatabase name:

    When finished, arangoexport will print out a summary line with some aggregate statistics about what it did, e.g.:

    1. Processed 2 collection(s), wrote 9031763 Byte(s), 78 HTTP request(s)
    1. unix> arangoexport --type json --collection test

    This exports the collection test into the output directory export as one json array.Every array entry is one document from the collection test

    Export JSONL

    This exports the collection test into the output directory export as jsonl. Every line in the export is one document from the collection test as json.

    1. unix> arangoexport --type csv --collection test --fields _key,_id,_rev

    This exports the collection test into the output directory export as CSV. The firstline contains the header with all field names. Each line is one document represented asCSV and separated with a comma. Objects and Arrays are represented as a JSON string.

    Export XML

    1. unix> arangoexport --type xml --collection test

    XGMML is an XML application based on.To view the XGMML file you can use for example Cytoscape.

    If you export all attributes (—xgmml-label-only false) note that attribute types have to be the same for all documents. It wont work if you have an attribute named rank that is in one document a string and in another document an integer.

    Bad

    1. "rank": 1
    2. }
    3. // doc2
    4. "rank": "2"
    5. }

    Good

    XGMML specific options

    —xgmml-label-attribute specify the name of the attribute that will become the label in the xgmml file.

    —xgmml-label-only set to true will only export the label without any attributes in edges or nodes.

    1. unix> arangoexport --type xgmml --graph-name mygraph --collection vertex --collection edge

    This exports the a unnamed graph with vertex collection vertex and edge collection edge into the xgmml file mygraph.xgmml.

    Export based on a named graph

    1. unix> arangoexport --type xgmml --graph-name mygraph

    This exports the named graph mygraph into the xgmml file mygraph.xgmml.

    Export XGMML without attributes

      This exports the named graph mygraph into the xgmml file mygraph.xgmml without the <att> tag in nodes and edges.

      Export XGMML with a specific label

      This exports the named graph mygraph into the xgmml file mygraph.xgmml with a label from documents attribute name instead of the default attribute label.

      Export via AQL query

      1. unix> arangoexport --type jsonl --query "for book in books filter book.sells > 100 return book"