Mongo Compass 1.24.1 force replicaset topology discovery on connection

497 Views Asked by At

While creating new connection on Mongo Compass the UI try to discover the entire replica set topology and connect to the primary/secondary IP.

Is there a way to create a DIRECT connection to an HOST/IP+Port just like the clients api and disable the topology discovery step?

From pymongo documentation: directConnection (optional): if True, forces this client to connect directly to the specified MongoDB host as a standalone. If false, the client connects to the entire replica set of which the given MongoDB host(s) is a part

2

There are 2 best solutions below

2
On

If you don't want to connect to a replicaset, use a mongodb connection string (as opposed to mongodb+srv), use a host IP / port, and drop the &replicaSet= parameter.

0
On

A bug ticket was opened to Mongo on Jira https://jira.mongodb.org/browse/COMPASS-4534 The fix should be in version 1.42.2