sheharyarn / mongo-sync

Sync Remote and Local MongoDB Databases :fire:
https://sheharyar.me/blog/sync-mongodb-local-and-production-heroku/
319 stars 89 forks source link

Using Local DB without credentials #23

Closed cdcv closed 5 years ago

cdcv commented 5 years ago

I am trying to sync to a local mongo db that doesn't use authentication (no username/pw). Is there already a way to do this? If not... can I suggest it as an addition?

Thank you for this lovely tool.

sheharyarn commented 5 years ago

Hi @cdcv, You can use mongo-sync with a local database without specifying the access parameters in the config.yml file if Access Control hasn't been enabled (i.e. there are no credentials to specify).

Here's a minimal example of config.yml that does not use credentials for the local database:

https://github.com/sheharyarn/mongo-sync/blob/1ae2aef4a8b40960be5c036e55af228f3351914a/config.yml#L1-L16