(
self,
bwc: Union[_BulkWriteContext, _EncryptedBulkWriteContext],
cmd: dict[str, Any],
ops: list[Mapping[str, Any]],
client: AsyncMongoClient[Any],
)
| 415 | return result # type: ignore[return-value] |
| 416 | |
| 417 | async def _execute_batch_unack( |
| 418 | self, |
| 419 | bwc: Union[_BulkWriteContext, _EncryptedBulkWriteContext], |
| 420 | cmd: dict[str, Any], |
| 421 | ops: list[Mapping[str, Any]], |
| 422 | client: AsyncMongoClient[Any], |
| 423 | ) -> list[Mapping[str, Any]]: |
| 424 | if self.is_encrypted: |
| 425 | _, batched_cmd, to_send = bwc.batch_command(cmd, ops) |
| 426 | await bwc.conn.command( # type: ignore[misc] |
| 427 | bwc.db_name, |
| 428 | batched_cmd, # type: ignore[arg-type] |
| 429 | write_concern=WriteConcern(w=0), |
| 430 | session=bwc.session, # type: ignore[arg-type] |
| 431 | client=client, # type: ignore[arg-type] |
| 432 | ) |
| 433 | else: |
| 434 | request_id, msg, to_send = bwc.batch_command(cmd, ops) |
| 435 | # Though this isn't strictly a "legacy" write, the helper |
| 436 | # handles publishing commands and sending our message |
| 437 | # without receiving a result. Send 0 for max_doc_size |
| 438 | # to disable size checking. Size checking is handled while |
| 439 | # the documents are encoded to BSON. |
| 440 | await self.unack_write(bwc, cmd, request_id, msg, 0, to_send, client) # type: ignore[arg-type] |
| 441 | |
| 442 | return to_send |
| 443 | |
| 444 | async def _execute_batch( |
| 445 | self, |
no test coverage detected