

This is because the client will make a solo connection if you just supply the connection point of a single mongod instance and leave off the replicaSet. It’s critical to provide a seed list of at least two mongod instances when connecting to a replica set. Replica set option: If the mongod is a member of a replica set, this specifies the name of the replica set.Option: This is also an optional part of URI, and it provides different connection options to the user, such as a replica set and TLS option.Specified database name: This is an optional part of URI, but we must authenticate the database using a username and password.Given below shows how URI works in MongoDB:īasically, MongoDB URI used different components as follows: Also, we need to provide the database name that we need to share with different hosts.

So we can connect the multiple port number and host numbers as per our requirement. Specify as many hosts as your deployment topology requires, and it is used to specify the port number that we need to connect with MongoDB. A hostname, IP address, or UNIX domain socket can all be specified.
#MONGODB COMPASS PLUGINS PASSWORD#
Specified user name: specified user name means the actual user name, and when we provide the user name, then the password is an optional part of this syntax.In the above syntax, we used different parameters as follows. mongodb: This is a mandatory prefix to indicate which string has a standard format.
