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

Function discover

test/asynchronous/utils.py:109–117  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

107
108 # Run hello until we have connected to each host at least once.
109 async def discover():
110 i = 0
111 while i < 100 and connected_host_list != target_host_list:
112 hello: dict = await client.admin.command(
113 HelloCompat.LEGACY_CMD, read_preference=ReadPreference.SECONDARY
114 )
115 connected_host_list.update([hello["me"]])
116 i += 1
117 return connected_host_list
118
119 try:
120

Callers 1

predicateFunction · 0.70

Calls 2

commandMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected