Console - EXPORT RECORD

Exports the current record, using the requested format. In the event that you give a format that OrientDB does not support, it provides a list of supported formats.

Syntax

  1. EXPORT RECORD <format>
  • <format> Defines the export format you want to use.

Examples

  • Use SELECT to create a record for export:

    1. orientdb> SELECT name, surname, parent, children, city FROM Person WHERE
    2. name='Barack' AND surname='Obama'
    3.  
    4. ---+-----+--------+---------+--------+------------+------
    5. # | RID | name | surname | parent | children | city
    6. ---+-----+--------+---------+--------+------------+------
    7. 0 | 5:4 | Barack | Obama | null | [5:5, 5:6] | -6:2
    8. ---+-----+--------+---------+--------+------------+------
  • Export JSON data from this record:

    1. orientdb> EXPORT RECORD JSON
    2.  
    3. {
    4. 'name': 'Barack',
    5. 'surname': 'Obama',
    6. 'parent': null,
    7. 'children': [5:5, 5:6],
    8. 'city': -6:2
    9. }
  • Use a bad format value to determine what export formats are available on your database:

    1. orientdb> EXPORT RECORD GIBBERISH
    2.  
    3. ERROR: Format 'GIBBERISH' was not found.
    4. Supported formats are:
    5. - json
    6. - ORecordDocument2csv

For more information on other commands, see Console Commands.