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

Function connected

test/asynchronous/__init__.py:1302–1310  ·  view source on GitHub ↗

Convenience to wait for a newly-constructed client to connect.

(client)

Source from the content-addressed store, hash-verified

1300
1301
1302async def connected(client):
1303 """Convenience to wait for a newly-constructed client to connect."""
1304 with warnings.catch_warnings():
1305 # Ignore warning that ping is always routed to primary even
1306 # if client's read preference isn't PRIMARY.
1307 warnings.simplefilter("ignore", UserWarning)
1308 await client.admin.command("ping") # Force connection.
1309
1310 return client
1311
1312
1313async def drop_collections(db: AsyncDatabase):

Calls 1

commandMethod · 0.45