Setting system environment variable varies from OSs
Linux
- open
/etc/profile
with super user access and addMONGO_URL_CON="mongodb://{username}:{password}@{server-ip-address-or-dns-address}:{portnumber}/{database-name}"
in the end - save it and logout-login or restart the OS
macOS Catalina 10.15.3
- open
/etc/zprofile
with super user access and addMONGO_URL_CON="mongodb://{username}:{password}@{server-ip-address-or-dns-address}:{portnumber}/{database-name}"
in the end - save it and logout-login or restart the OS
Windows
- Choose
Advanced System settings
- Click on the
Environment Variables
button - Click on the
New
button underSystem Variables
- Set
MONGO_URL_CON
as the environment variable name - Set the
mongodb://{username}:{password}@{server-ip-address-or-dns-address}:{portnumber}/{database-name}
as the environment variable Value - Click
OK
and close theMONGO_URL_CON
environment variable editor
Example MongoDB connection string looks like mongodb://pranava:vel0city@localhost:27017/eventms
The setup of cloud MongoDB hosted server is HERE
Project Velocity - Copyright (c) 2020 Pranava Giligar