MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / rs_or_single_client

Method rs_or_single_client

test/__init__.py:1108–1113  ·  view source on GitHub ↗

Connect to the replica set if there is one, otherwise the standalone. Authenticates if necessary.

(self, h: Any = None, p: Any = None, **kwargs: Any)

Source from the content-addressed store, hash-verified

1106 return self._async_mongo_client(h, p, authenticate=False, **kwargs)
1107
1108 def rs_or_single_client(self, h: Any = None, p: Any = None, **kwargs: Any) -> MongoClient[Any]:
1109 """Connect to the replica set if there is one, otherwise the standalone.
1110
1111 Authenticates if necessary.
1112 """
1113 return self._async_mongo_client(h, p, **kwargs)
1114
1115 def simple_client(self, h: Any = None, p: Any = None, **kwargs: Any) -> MongoClient:
1116 if not h and not p:

Calls 1

_async_mongo_clientMethod · 0.95