In my previous post, I had written about my
mongo-sync shell script that allows you to sync Local and Remote Mongo Databases.
I spent the last day converting it into a Ruby Gem
so that you can perform actions using nice Rake Tasks and invoke the commands from Rails Console or irb.

If the gif above wasn’t explanatory enough, start by adding it to your Gemfile:

1

gem'mongo_sync',group::development

Bundle and run the generator to create configuration template:

12

$ bundle
$ rails g mongo_sync:config

Edit the newly created config/mongo_sync.yml, putting in details of your remote and local DBs: