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

Function _client_do_batched_op_msg

pymongo/message.py:1228–1245  ·  view source on GitHub ↗

Create the next batched client-level bulkWrite operation using OP_MSG.

(
    command: MutableMapping[str, Any],
    operations: list[tuple[str, Mapping[str, Any]]],
    namespaces: list[str],
    opts: CodecOptions[Any],
    ctx: _ClientBulkWriteContext,
)

Source from the content-addressed store, hash-verified

1226
1227
1228def _client_do_batched_op_msg(
1229 command: MutableMapping[str, Any],
1230 operations: list[tuple[str, Mapping[str, Any]]],
1231 namespaces: list[str],
1232 opts: CodecOptions[Any],
1233 ctx: _ClientBulkWriteContext,
1234) -> tuple[int, bytes, list[Mapping[str, Any]], list[Mapping[str, Any]]]:
1235 """Create the next batched client-level bulkWrite
1236 operation using OP_MSG.
1237 """
1238 command["$db"] = "admin"
1239 if "writeConcern" in command:
1240 ack = bool(command["writeConcern"].get("w", 1))
1241 else:
1242 ack = True
1243 if ctx.conn.compression_context:
1244 return _client_batched_op_msg_compressed(command, operations, namespaces, ack, opts, ctx)
1245 return _client_batched_op_msg(command, operations, namespaces, ack, opts, ctx)
1246
1247
1248# End OP_MSG -----------------------------------------------------

Callers 1

batch_commandMethod · 0.85

Calls 3

_client_batched_op_msgFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected