According to MongoDB docs,
“The mongodb connection string username and password are optional. If username and password are specified in connection string, the client will attempt to log in to the specific database using the same credentials after connecting to the MongoDB instance.”
Stayed Informed - MongoDB CRUD Operation in C#.NET
The mongodb connection string URL's standard format and used to connect to MongoDB database server.
· :portX ,
The default value of “:port1”, “portX”, and “:portX” is "27017"
Example, the following MongoDB hosts
db1.code-sample.com on port 27017 and db2.code-sample.com on port 2500
The mongodb connection string looks like,
For more detail, go to https://docs.mongodb.com/manual/reference/connection-string/#uri.ssl