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

Function _add_to_command

pymongo/server_api.py:161–173  ·  view source on GitHub ↗

Internal helper which adds API versioning options to a command. :param cmd: The command. :param server_api: A :class:`ServerApi` or ``None``.

(cmd: MutableMapping[str, Any], server_api: Optional[ServerApi])

Source from the content-addressed store, hash-verified

159
160
161def _add_to_command(cmd: MutableMapping[str, Any], server_api: Optional[ServerApi]) -> None:
162 """Internal helper which adds API versioning options to a command.
163
164 :param cmd: The command.
165 :param server_api: A :class:`ServerApi` or ``None``.
166 """
167 if not server_api:
168 return
169 cmd["apiVersion"] = server_api.version
170 if server_api.strict is not None:
171 cmd["apiStrict"] = server_api.strict
172 if server_api.deprecation_errors is not None:
173 cmd["apiDeprecationErrors"] = server_api.deprecation_errors

Callers 2

add_server_apiMethod · 0.90
add_server_apiMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected