Create the next batched insert, update, or delete operation with OP_MSG, compressed.
(
operation: int,
command: Mapping[str, Any],
docs: list[Mapping[str, Any]],
ack: bool,
opts: CodecOptions[Any],
ctx: _BulkWriteContext,
)
| 856 | |
| 857 | |
| 858 | def _batched_op_msg_compressed( |
| 859 | operation: int, |
| 860 | command: Mapping[str, Any], |
| 861 | docs: list[Mapping[str, Any]], |
| 862 | ack: bool, |
| 863 | opts: CodecOptions[Any], |
| 864 | ctx: _BulkWriteContext, |
| 865 | ) -> tuple[int, bytes, list[Mapping[str, Any]]]: |
| 866 | """Create the next batched insert, update, or delete operation |
| 867 | with OP_MSG, compressed. |
| 868 | """ |
| 869 | data, to_send = _encode_batched_op_msg(operation, command, docs, ack, opts, ctx) |
| 870 | |
| 871 | assert ctx.conn.compression_context is not None |
| 872 | request_id, msg = _compress(2013, data, ctx.conn.compression_context) |
| 873 | return request_id, msg, to_send |
| 874 | |
| 875 | |
| 876 | def _batched_op_msg( |
no test coverage detected