Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Description of import and export feature introduced in RethinkDB 1.7.

You can import data as follows:

# Import a JSON document into table `users` in database `my_db`
$ rethinkdb import -c HOST:PORT -f user_data.json --table my_db.users

# Import a CSV document
$ rethinkdb import -c HOST:PORT -f user_data.csv --format csv --table my_db.users

The export command works as follows:

# Export a table into a JSON file (placed in the directory
# rethinkdb_export_DATE_TIME by default)
$ rethinkdb export -c HOST:PORT -e my_db.users

# Export a table into a CSV file
$ rethinkdb export -c HOST:PORT -e my_db.users --format csv \
                   --fields first_name,last_name,address      # `--fields` is mandatory when exporting into CSV

This is only a small taste of what import and export commands can do. Run rethinkdb import --help and rethinkdb export --help for more information on these commands.

See more about the 1.7 release in the release announcement.

@BarthesSimpson

This comment has been minimized.

Copy link

BarthesSimpson commented Apr 8, 2014

Getting this error when trying to import a csv:
new-line character seen in unquoted field - do you need to open the file in universal-newline mode?

export works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.