Reputation: 3721
I'm trying to connect my development app to a remote mongodb at mongolabs. I have tried to change the environment settings in the settings.json
file to:
"env": {
"MONGO_URL": "mongodb://xxxxx:[email protected]:xxxx/xxxx"
}
and to:
"env": {
"export MONGO_URL": "mongodb://xxxxx:[email protected]:xxxx/xxxx"
}
I have also tried these two above commands in the terminal, which gives me a error of `'export' is not recognized as an internal or external command, operable program or batch file.
Or:
'MONGO_URL' is not recognized as an internal or external command,
operable program or batch file.
Where else can the environment
variables be changed to connect to the remote DB?
Upvotes: 2
Views: 1162
Reputation: 2010
From the command line run this:
Linux:
export MONGO_URL=mongodb://xxxxx:[email protected]:xxxx/xxxx
Windows:
set MONGO_URL=mongodb://xxxxx:[email protected]:xxxx/xxxx
I don't think "env" in the settings.json file is supported.
EDIT:
If you want to control this based on logged in user (i.e. if you have a dev user, prod user, etc.) then add this export line (linux only) to your .bashrc file so that when the user logs in, this environment variable is automatically set.
Upvotes: 6