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

Function get_pool

test/utils.py:42–46  ·  view source on GitHub ↗

Get the standalone, primary, or mongos pool.

(client: MongoClient)

Source from the content-addressed store, hash-verified

40
41
42def get_pool(client: MongoClient) -> Pool:
43 """Get the standalone, primary, or mongos pool."""
44 topology = client._get_topology()
45 server = topology._select_server(writable_server_selector, _Op.TEST)
46 return server.pool
47
48
49def get_pools(client: MongoClient) -> list[Pool]:

Calls 2

_get_topologyMethod · 0.45
_select_serverMethod · 0.45