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

Function connected

test/__init__.py:1286–1294  ·  view source on GitHub ↗

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

(client)

Source from the content-addressed store, hash-verified

1284
1285
1286def connected(client):
1287 """Convenience to wait for a newly-constructed client to connect."""
1288 with warnings.catch_warnings():
1289 # Ignore warning that ping is always routed to primary even
1290 # if client's read preference isn't PRIMARY.
1291 warnings.simplefilter("ignore", UserWarning)
1292 client.admin.command("ping") # Force connection.
1293
1294 return client
1295
1296
1297def drop_collections(db: Database):

Calls 1

commandMethod · 0.45