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

Method _read_preference_for

pymongo/common.py:962–967  ·  view source on GitHub ↗

Read only access to the read preference of this instance or session.

(self, session: Optional[_AgnosticClientSession])

Source from the content-addressed store, hash-verified

960 return self._read_preference
961
962 def _read_preference_for(self, session: Optional[_AgnosticClientSession]) -> _ServerMode:
963 """Read only access to the read preference of this instance or session."""
964 # Override this operation's read preference with the transaction's.
965 if session:
966 return session._txn_read_preference() or self._read_preference
967 return self._read_preference
968
969 @property
970 def read_concern(self) -> ReadConcern:

Callers 12

get_read_preferenceMethod · 0.80
_run_aggregation_cmdMethod · 0.80
_get_read_preferenceMethod · 0.80
_refreshMethod · 0.80
_commandMethod · 0.80
get_read_preferenceMethod · 0.80
_run_aggregation_cmdMethod · 0.80
_get_read_preferenceMethod · 0.80
_refreshMethod · 0.80
_commandMethod · 0.80

Calls 1

_txn_read_preferenceMethod · 0.45

Tested by

no test coverage detected