MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / use_command

Method use_command

pymongo/message.py:1789–1798  ·  view source on GitHub ↗
(self, conn: _AgnosticConnection)

Source from the content-addressed store, hash-verified

1787 return f"{self.db}.{self.coll}"
1788
1789 def use_command(self, conn: _AgnosticConnection) -> bool:
1790 use_cmd = False
1791 if not self.exhaust:
1792 use_cmd = True
1793 elif conn.max_wire_version >= 8:
1794 # OP_MSG supports exhaust on MongoDB 4.2+
1795 use_cmd = True
1796
1797 conn.validate_session(self.client, self.session) # type: ignore[arg-type]
1798 return use_cmd
1799
1800 def update_command(self, cmd: dict[str, Any]) -> None:
1801 self._as_command = cmd, self.db

Callers

nothing calls this directly

Calls 1

validate_sessionMethod · 0.45

Tested by

no test coverage detected