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

Function _client_encode_batched_op_msg

pymongo/message.py:1159–1175  ·  view source on GitHub ↗

Encode the next batched client-level bulkWrite operation as OP_MSG.

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

Source from the content-addressed store, hash-verified

1157
1158
1159def _client_encode_batched_op_msg(
1160 command: Mapping[str, Any],
1161 operations: list[tuple[str, Mapping[str, Any]]],
1162 namespaces: list[str],
1163 ack: bool,
1164 opts: CodecOptions[Any],
1165 ctx: _ClientBulkWriteContext,
1166) -> tuple[bytes, list[Mapping[str, Any]], list[Mapping[str, Any]]]:
1167 """Encode the next batched client-level bulkWrite
1168 operation as OP_MSG.
1169 """
1170 buf = _BytesIO()
1171
1172 to_send_ops, to_send_ns, _ = _client_batched_op_msg_impl(
1173 command, operations, namespaces, ack, opts, ctx, buf
1174 )
1175 return buf.getvalue(), to_send_ops, to_send_ns
1176
1177
1178def _client_batched_op_msg_compressed(

Callers 1

Calls 1

Tested by

no test coverage detected