Self-hosted cluster connector to application

Hi there, I am very new to mongodb, I have managed to create a cluster composed by 3 servers 1 primary and 2 secondary, replication is working but I am stuck on how I will connect my application to that cluster and make sure if te primary mongodb server fails my application can connect to the other servers in the cluster.

Probably I am not asking a very smart question, but I need some help to where look for the solution, thanks.

Hi @jonathan_canales

When a driver connects to a replicaSet it discovers the topology of the replicaSet and will become aware of the other member it can use.

Typically all hosts that could become primary(priority > 0 and can vote in replica set elections) are in the connection string, these are used as the seed nodes in the discovery during connection.

You can read up on this at, also be sure so check the driver documentation for driver specific options and nuances.