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

Function apply_write_concern

pymongo/_csot.py:130–140  ·  view source on GitHub ↗

Apply the given write concern to a command.

(
    cmd: MutableMapping[str, Any], write_concern: Optional[WriteConcern]
)

Source from the content-addressed store, hash-verified

128
129
130def apply_write_concern(
131 cmd: MutableMapping[str, Any], write_concern: Optional[WriteConcern]
132) -> None:
133 """Apply the given write concern to a command."""
134 if not write_concern or write_concern.is_server_default:
135 return
136 wc = write_concern.document
137 if get_timeout() is not None:
138 wc.pop("wtimeout", None)
139 if wc:
140 cmd["writeConcern"] = wc
141
142
143_MAX_RTT_SAMPLES: int = 10

Callers

nothing calls this directly

Calls 2

get_timeoutFunction · 0.85
popMethod · 0.45

Tested by

no test coverage detected