Encode the next batched insert, update, or delete operation as OP_MSG.
(
operation: int,
command: Mapping[str, Any],
docs: list[Mapping[str, Any]],
ack: bool,
opts: CodecOptions[Any],
ctx: _BulkWriteContext,
)
| 835 | |
| 836 | |
| 837 | def _encode_batched_op_msg( |
| 838 | operation: int, |
| 839 | command: Mapping[str, Any], |
| 840 | docs: list[Mapping[str, Any]], |
| 841 | ack: bool, |
| 842 | opts: CodecOptions[Any], |
| 843 | ctx: _BulkWriteContext, |
| 844 | ) -> tuple[bytes, list[Mapping[str, Any]]]: |
| 845 | """Encode the next batched insert, update, or delete operation |
| 846 | as OP_MSG. |
| 847 | """ |
| 848 | buf = _BytesIO() |
| 849 | |
| 850 | to_send, _ = _batched_op_msg_impl(operation, command, docs, ack, opts, ctx, buf) |
| 851 | return buf.getvalue(), to_send |
| 852 | |
| 853 | |
| 854 | if _use_c: |
no test coverage detected