Setting system environment variable varies from OSs
Linux
- open
/etc/profilewith 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/zprofilewith 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 Variablesbutton - Click on the
Newbutton underSystem Variables - Set
MONGO_URL_CONas the environment variable name - Set the
mongodb://{username}:{password}@{server-ip-address-or-dns-address}:{portnumber}/{database-name}as the environment variable Value - Click
OKand close theMONGO_URL_CONenvironment 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