-1

I have a node server and until now my database was local, but now I need it to be on mongolab.

Could you tell me how to connect to the database, please?

user3199819
  • 71
  • 1
  • 5

1 Answers1

1
  1. Go to https://mongolab.com/databases/YOUR_DATABASE_NAME

  2. Copy the URI from your database's page on Mongolab.

  3. Use var db = mongojs('mongodb://USERNAME:PASSWORD@ds043497.mongolab.com:43497/heroku_app14986764', ['CollectionName']);

And you'll be connected. I did not test this.

aleclarson
  • 18,087
  • 14
  • 64
  • 91