Changing the default mongodb database of a Meteor application

1

Hello, I'm starting to work with Meteor and I'm having a hard time defining where the database of the same along with the access user with authentication. Searching the internet, I found some references that say I should start the application using this command ( as in this question ):

"MONGO_URL=mongodb://127.0.0.1:27017/mydb meteor run"

The problem is, even using the possible solutions given in the question I have not yet succeeded in getting the Meteor to access a database other than the one it created, and also use a database access user.

Does anyone have any reference how I can actually change the Meteor database?

    
asked by anonymous 19.12.2016 / 15:25

1 answer

1

As I answered in another question of yours, you just have to customize your package.json file, creating a "scripts" key and put your bank data as you wish. You can create scripts for different banks, such as:

{
  "scripts": {
    "development": "MONGO_URL=mongodb://localhost:27017/devdb meteor run",
    "testing": "MONGO_URL=mongodb://localhost:27017/testdb meteor run",
  }
}

Then you can run under development:

$ meteor npm run development

And to run in the test environment:

$ meteor npm run testing
    
06.05.2017 / 18:56