How can I access a production Mongo DB database on modulus with meteor?

706 views Asked by At

I have the URI of the modulus database, but I don't know how to connect to it through meteor mongo. What command can I use?

1

There are 1 answers

2
Stephan On

The easiest way to connect to an external Mongo database with Meteor is to use an environment variable when starting Meteor:

$ export MONGO_URL="mongodb://user:[email protected]/dbname"
$ meteor run

The syntax for the mongo connection string is

mongodb://<username>:<password>@<host>/<database>?<options>

When hosting with modulus they have a dedicated page where you can set environment variables.