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

Method _execute_batch_unack

pymongo/asynchronous/bulk.py:417–442  ·  view source on GitHub ↗
(
        self,
        bwc: Union[_BulkWriteContext, _EncryptedBulkWriteContext],
        cmd: dict[str, Any],
        ops: list[Mapping[str, Any]],
        client: AsyncMongoClient[Any],
    )

Source from the content-addressed store, hash-verified

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,

Callers 2

_execute_commandMethod · 0.95

Calls 4

unack_writeMethod · 0.95
WriteConcernClass · 0.90
batch_commandMethod · 0.45
commandMethod · 0.45

Tested by

no test coverage detected