I was playing around tonight with RethinkDB – and I wanted to import some data from a JSON file. It wasn’t very well documented, so I wanted to make sure I high-light that for others. The tutorial post to see RethinkDB’s import covers this command to fire off:
1
|
|
It’s real easy – lets break it down:
- The first part,
-c localhost:28015
specifies the cluster host and port. - The next,
--table registry.plugins
specifies the database ‘registry’, and the table ‘plugins’. - Next up is specifying the primary index key of ‘_id’ with
--pkey _id
. - Finally,
-f plugins.json --format json
tells Rethink to pull in the file located in the CWD named plugins.json, in the jason formats!
Chances are, you might not have that Python driver, which gives you this message:
1 2 3 4 |
|
If thats the case, run the command to install the rethinkdb-import Python driver:
1
|
|
Boom! Now get back to work.