mongodb:// |
Designates this URI as a MongoDB connection |
Required unless using mongodb+srv:// |
mongodb+srv:// |
As above, plus requires a DNS SRV record for the server |
Required unless using mongodb:// |
username |
The MongoDB username used to access the database |
Optional |
password |
The password associated with the MongoDB username used to access the database |
Optional |
host |
The host name or IP address |
Required |
port |
The host port to use to communicate with the server |
Optional (only required if the database being connected to is not using the default port) |
defaultdb |
The default database to access |
Optional |