Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to set mongodb path in meteor on window system

Tags:

mongodb

meteor

I googled for the whole day but did not found any solution to change default database in meteor for window system. All findings are as follows

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

Gives error on window system -

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

Used settings.json as

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

and then meteor --settings ./settings.json

but still it does not pick this mongo setting. Finally in my js file

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

This also not working. Any suggestion in this regard will be highly appreciated.

like image 557
Rohit Bansal Avatar asked Oct 20 '25 08:10

Rohit Bansal


1 Answers

If I am not mistaken Meteor settings are used only for deployment.

To use another MongoDB than the local one on windows during development, you can create a batch file (*.bat) containing the following commands in your Meteor app folder:

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

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

like image 185
Guillaume Avatar answered Oct 22 '25 23:10

Guillaume



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!