MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / _client_batched_op_msg_compressed

Function _client_batched_op_msg_compressed

pymongo/message.py:1178–1195  ·  view source on GitHub ↗

Create the next batched client-level bulkWrite operation with OP_MSG, compressed.

(
    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

1176
1177
1178def _client_batched_op_msg_compressed(
1179 command: Mapping[str, Any],
1180 operations: list[tuple[str, Mapping[str, Any]]],
1181 namespaces: list[str],
1182 ack: bool,
1183 opts: CodecOptions[Any],
1184 ctx: _ClientBulkWriteContext,
1185) -> tuple[int, bytes, list[Mapping[str, Any]], list[Mapping[str, Any]]]:
1186 """Create the next batched client-level bulkWrite operation
1187 with OP_MSG, compressed.
1188 """
1189 data, to_send_ops, to_send_ns = _client_encode_batched_op_msg(
1190 command, operations, namespaces, ack, opts, ctx
1191 )
1192
1193 assert ctx.conn.compression_context is not None
1194 request_id, msg = _compress(2013, data, ctx.conn.compression_context)
1195 return request_id, msg, to_send_ops, to_send_ns
1196
1197
1198def _client_batched_op_msg(

Callers 1

Calls 2

_compressFunction · 0.85

Tested by

no test coverage detected