Connect to a single member or replica of a sharded cluster

Hi folks.
We’re using Atlas for our db. We’ve got a global cluster and just sharded some collections and want to physically check the collection and documents exist in the correct region.

We can connect to the cluster with the cli and nodejs driver using the +srv address, we can do things like explain() to see where the query is going, but how can I connect to a single member or replica set to physically look at what resides on it?
I’ve tried mongo --host xxx-shard-01-00.abcd.mongodb.net --username xxx and I get the following

*** You have failed to connect to a MongoDB Atlas cluster. Please ensure that your IP whitelist allows connections from your network. Error: network error while attempting to run command 'isMaster' on host

I’m guessing the instance has no idea about auth and it’s handled by the config servers?

Forgot to add, using mongo 4.4.6 and same for shell for mongo cli

As always the case, soon after posting I figure it out.

mongo "mongodb://USERNAME:PASSWORD@my-shard-01-00.abcd.mongodb.net:27017,my-shard-01-01.abcd.mongodb.net:27017,my-shard-01-02.abcd.mongodb.net:27017/my-database?replicaSet=my-shard-1" --authenticationDatabase admin --ssl

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