Create the next batched client-level bulkWrite operation using OP_MSG.
(
command: MutableMapping[str, Any],
operations: list[tuple[str, Mapping[str, Any]]],
namespaces: list[str],
opts: CodecOptions[Any],
ctx: _ClientBulkWriteContext,
)
| 1226 | |
| 1227 | |
| 1228 | def _client_do_batched_op_msg( |
| 1229 | command: MutableMapping[str, Any], |
| 1230 | operations: list[tuple[str, Mapping[str, Any]]], |
| 1231 | namespaces: list[str], |
| 1232 | opts: CodecOptions[Any], |
| 1233 | ctx: _ClientBulkWriteContext, |
| 1234 | ) -> tuple[int, bytes, list[Mapping[str, Any]], list[Mapping[str, Any]]]: |
| 1235 | """Create the next batched client-level bulkWrite |
| 1236 | operation using OP_MSG. |
| 1237 | """ |
| 1238 | command["$db"] = "admin" |
| 1239 | if "writeConcern" in command: |
| 1240 | ack = bool(command["writeConcern"].get("w", 1)) |
| 1241 | else: |
| 1242 | ack = True |
| 1243 | if ctx.conn.compression_context: |
| 1244 | return _client_batched_op_msg_compressed(command, operations, namespaces, ack, opts, ctx) |
| 1245 | return _client_batched_op_msg(command, operations, namespaces, ack, opts, ctx) |
| 1246 | |
| 1247 | |
| 1248 | # End OP_MSG ----------------------------------------------------- |
no test coverage detected