Hi at All!
i have external mongo database on mLAb.
I need to connect my meteor application at remote database.
I read a lot online but I do not understand how to do it
Please, can someone help me?
Thanks
Luca
Hi at All!
i have external mongo database on mLAb.
I need to connect my meteor application at remote database.
I read a lot online but I do not understand how to do it
Please, can someone help me?
Thanks
Luca
Hi @luca1982, You can use the MONGO_URL environment variable to define which MONGO Database should be used by your Meteor App. Refer to=> Environment Variables | Meteor API Docs
I have not used mLab, I think it should be something like
=> refer to https://docs.mlab.com/ , Step 3 in the Quick Start Guide.Select a datacenter in mlab where your meteor application is hosted. Then mlab will provide you a connection string. Use that connection string as your MONGO_URL when you start your meteor app.
HI!
thanks for your reply!
in the mlab account i have copied the connection string. But how should I write MONGO_URL the string in meteor ? In the server mail.js in the Meteor.isStart?
Thanks
Luca
Hi @luca1982, I hope you are running your meteor application using the command “meteor” from the command line. You need to set the MONGO_URL environment variable before running your application. You need to do it in the same Command-line session so that the environment variables is effective. Here is how you can set the MONGO_URL environment variable.
In Windows:
https://www.computerhope.com/issues/ch000549.htm should help.
In Mac: