How to make mongosh / nodejs driver respect connection string

Hey
How do we make mongosh and the nodejs driver respect the connection string we give it ?
example, if i have a replica set named rs0 and it works locally, and i can connect using mongodb://mongo-0.demo3.domain.com:27017/db and mongodb://mongo-1.demo3.domain.com:27017/db
then why does mongodb://mongo-0.demo3.domain.com:27017,mongo-1.demo3.domain.com:27017/db?replicaSet=rs0 not work? How do we make the clients stop using internal hostnames and use the hostnames given in the connection string

When a client connects to a member of the seed list, the client retrieves a list of replica set members it can connect to. Clients often use DNS aliases in their seed lists which means the host may return a server list that differs from the original seed list. If this happens, clients will use the hostnames provided by the replica set rather than the hostnames listed in the seed list to ensure that replica set members can be reached via the hostnames in the resulting replica set config.

When creating a replicaset the hostnames should be the FQDN that any client or other replicaset member can resolve and connect to.

But as long as the hosts returned by db.hello().hosts are resolvable and connectable it will work as expected.

This post was made in frustration over no resolution to this question

But i finally made it work. Update in original question

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.