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

Function _encode_batched_op_msg

pymongo/message.py:837–851  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

835
836
837def _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
854if _use_c:

Callers 1

Calls 1

_batched_op_msg_implFunction · 0.85

Tested by

no test coverage detected