Bulk Import from MongoDB
This article explains how to dump data from MongoDB and import it into Treasure Data.
Table of Contents
Install Bulk Loader
First, please install the toolbelt, which includes bulk loader program, on your computer.
After the installation, the
td command will be installed on your computer. Open up the terminal, and type
td to execute the command. Also, make sure you have
java as well. Please execute
td import:jar_update to download the up-to-date version of our bulk loader:
$ td usage: td [options] COMMAND [args] $ java Usage: java [-options] class [args...] $ td import:jar_update Installed td-import.jar 0.x.xx into /path/to/.td/java
mongoexport command to export a collection into JSON (default) or CSV format as shown below:
$ mongoexport --db users --collection contacts --out /tmp/result.json $ mongoexport --db users --collection contacts --csv --out /tmp/result.csv
For more information, please consult the MongoDB documentation.
Bulk Import from CSV file or JSON file
For further details, check the following pages:
Last modified: Aug 03 2015 00:01:48 UTC