(
self,
bwc: Union[_BulkWriteContext, _EncryptedBulkWriteContext],
cmd: dict[str, Any],
ops: list[Mapping[str, Any]],
client: MongoClient[Any],
)
| 442 | return to_send |
| 443 | |
| 444 | def _execute_batch( |
| 445 | self, |
| 446 | bwc: Union[_BulkWriteContext, _EncryptedBulkWriteContext], |
| 447 | cmd: dict[str, Any], |
| 448 | ops: list[Mapping[str, Any]], |
| 449 | client: MongoClient[Any], |
| 450 | ) -> tuple[dict[str, Any], list[Mapping[str, Any]]]: |
| 451 | if self.is_encrypted: |
| 452 | _, batched_cmd, to_send = bwc.batch_command(cmd, ops) |
| 453 | result = bwc.conn.command( # type: ignore[misc] |
| 454 | bwc.db_name, |
| 455 | batched_cmd, # type: ignore[arg-type] |
| 456 | codec_options=bwc.codec, |
| 457 | session=bwc.session, # type: ignore[arg-type] |
| 458 | client=client, # type: ignore[arg-type] |
| 459 | ) |
| 460 | else: |
| 461 | request_id, msg, to_send = bwc.batch_command(cmd, ops) |
| 462 | result = self.write_command(bwc, cmd, request_id, msg, to_send, client) # type: ignore[arg-type] |
| 463 | |
| 464 | return result, to_send # type: ignore[return-value] |
| 465 | |
| 466 | def _execute_command( |
| 467 | self, |
no test coverage detected