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

Method _execute_batch

pymongo/synchronous/bulk.py:444–464  ·  view source on GitHub ↗
(
        self,
        bwc: Union[_BulkWriteContext, _EncryptedBulkWriteContext],
        cmd: dict[str, Any],
        ops: list[Mapping[str, Any]],
        client: MongoClient[Any],
    )

Source from the content-addressed store, hash-verified

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,

Callers 1

_execute_commandMethod · 0.95

Calls 3

write_commandMethod · 0.95
batch_commandMethod · 0.45
commandMethod · 0.45

Tested by

no test coverage detected