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

Method uri

test/__init__.py:148–163  ·  view source on GitHub ↗

Return the MongoClient URI for creating a duplicate client.

(self)

Source from the content-addressed store, hash-verified

146
147 @property
148 def uri(self):
149 """Return the MongoClient URI for creating a duplicate client."""
150 opts = client_context.default_client_options.copy()
151 opts.pop("server_api", None) # Cannot be set from the URI
152 opts_parts = []
153 for opt, val in opts.items():
154 strval = str(val)
155 if isinstance(val, bool):
156 strval = strval.lower()
157 opts_parts.append(f"{opt}={quote_plus(strval)}")
158 opts_part = "&".join(opts_parts)
159 auth_part = ""
160 if client_context.auth_enabled:
161 auth_part = f"{quote_plus(db_user)}:{quote_plus(db_pwd)}@"
162 pair = self.pair
163 return f"mongodb://{auth_part}{pair}/?{opts_part}"
164
165 @property
166 def hello(self):

Callers

nothing calls this directly

Calls 4

copyMethod · 0.80
itemsMethod · 0.80
popMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected