Unable to set mongodb path to meteor on window system

I googled all day, but did not find a solution to change the default database to a meteor for the window system. All conclusions are as follows.

MONGO_URL=mongodb://127.0.0.1:27018/meteor meteor 

Gives an error in the window system -

"MONGO_URL" is not recognized as an internal or external command,

Use settings.json as

 { "MONGO_URL":"mongodb://127.0.0.1:27018/meteor" } 

and then the meteor --settings ./settings.json

but still he does not select this mango setting. Finally, in my js file

 if (Meteor.isServer){ process.env.MONGO_URL="mongodb://127.0.0.1:27018/meteor" } 

This does not work either. Any suggestion in this regard would be greatly appreciated.

+2
source share
2 answers

If I'm not mistaken, Meteor settings are used only for deployment.

To use a different MongoDB than the local one in Windows during development, you can create a batch file (* .bat) containing the following commands in the Meteor application folder:

 SET MONGO_URL=mongodb://localhost:27017/name_of_the_db meteor 

(Given that your MongoDB server is listening on localhost: 27017, which are the default settings)

+7
source

I recommend that you download MongoDB from www.mongodb.com and install mongoose in your CML (Terminal) to manipulate MongoDB on your local machine or remote MongoDB. and use mongoose.connect ('Mongodb: // http: localhost: port / nameofdatabase') to connect the local database and use the mongoose.connect ('mongodb: // username: password / remoteservice.com: port / databasename') method to connect to a remote database

0
source

All Articles