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:
It’s real easy – lets break it down:
- The first part,
-c localhost:28015specifies the cluster host and port.
- The next,
--table registry.pluginsspecifies the database ‘registry’, and the table ‘plugins’.
- Next up is specifying the primary index key of ‘_id’ with
-f plugins.json --format jsontells 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:
Boom! Now get back to work.