When running against Atlas sharded clusters, the permission doesn't allow us to directly connect to the shard nodes. Which leads to the following error
Failed to get execution result from atlas-vnfeuv-shard-0, member atlas-vnfeuv-shard-00-00.wy1z6.mongodb.net:27017: OperationFailure You are connecting to a sharded cluster improperly by connecting directly to a shard. Please connect to the cluster via a router (mongos). Command: listDatabases, Namespace: Foo, full error: {'ok': 0.0, 'errmsg': 'You are connecting to a sharded cluster improperly by connecting directly to a shard. Please connect to the cluster via a router (mongos). Command: listDatabases, Namespace: Foo', 'code': 13, 'codeName': 'Unauthorized', '$clusterTime': {'clusterTime': Timestamp(1773141907, 2), 'signature': {'hash': b'8\xcf\xb2\x8dn\xf7\\\xc7\xdfW\xaa<\x8f\x8bQ$\x1ao\x0c\xe3', 'keyId': 7615245592997920791}}, 'operationTime': Timestamp(1773141904, 1)}
When running against Atlas sharded clusters, the permission doesn't allow us to directly connect to the shard nodes. Which leads to the following error
This happens to
CollInfoItemandIndexInfoItem.Find a workaround to fix the problem.