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

Method execute_command_no_results

pymongo/synchronous/bulk.py:654–688  ·  view source on GitHub ↗

Execute write commands with OP_MSG and w=0 WriteConcern, ordered.

(
        self,
        conn: Connection,
        generator: Iterator[Any],
        write_concern: WriteConcern,
    )

Source from the content-addressed store, hash-verified

652 self.current_run = run = next(generator, None)
653
654 def execute_command_no_results(
655 self,
656 conn: Connection,
657 generator: Iterator[Any],
658 write_concern: WriteConcern,
659 ) -> None:
660 """Execute write commands with OP_MSG and w=0 WriteConcern, ordered."""
661 full_result = {
662 "writeErrors": [],
663 "writeConcernErrors": [],
664 "nInserted": 0,
665 "nUpserted": 0,
666 "nMatched": 0,
667 "nModified": 0,
668 "nRemoved": 0,
669 "upserted": [],
670 }
671 # Ordered bulk writes have to be acknowledged so that we stop
672 # processing at the first error, even when the application
673 # specified unacknowledged writeConcern.
674 initial_write_concern = WriteConcern()
675 op_id = _randint()
676 try:
677 self._execute_command(
678 generator,
679 initial_write_concern,
680 None,
681 conn,
682 op_id,
683 False,
684 full_result,
685 write_concern,
686 )
687 except OperationFailure:
688 pass
689
690 def execute_no_results(
691 self,

Callers 1

execute_no_resultsMethod · 0.95

Calls 3

_execute_commandMethod · 0.95
WriteConcernClass · 0.90
_randintFunction · 0.90

Tested by

no test coverage detected