How can I migrate my MongoDB collections to RethinkDB tables?
I'm not concerned about changing my old Mongo _id
's to Rethink id
's because they will be ignored in my implementation, and I'm not concerned about them cluttering my data.
How can I migrate my MongoDB collections to RethinkDB tables?
I'm not concerned about changing my old Mongo _id
's to Rethink id
's because they will be ignored in my implementation, and I'm not concerned about them cluttering my data.
I wrote a quick BASH script to solve this. Because I only had the JavaScript RethinkDB driver, I had to install the python driver first so I could use
rethinkdb import
.For this example, I am migrating the mongo collections:
users
,pinboards
, andanalytics
; add your collections as needed to the following BASH command:Don't forget to change the names of your collections, host, and database. Also, adjust arguments to
mongoexport
andrethinkdb import
as needed.This is quick and dirty, but I hope it gets someone started in the right direction!