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

Method _get_read_preference

pymongo/synchronous/cursor.py:873–877  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

871 return response.unpack_response(cursor_id, codec_options, user_fields, legacy_response)
872
873 def _get_read_preference(self) -> _ServerMode:
874 if self._read_preference is None:
875 # Save the read preference for getMore commands.
876 self._read_preference = self._collection._read_preference_for(self.session)
877 return self._read_preference
878
879 def __copy__(self) -> Cursor[_DocumentType]:
880 """Support function for `copy.copy()`.

Callers 1

_refreshMethod · 0.95

Calls 1

_read_preference_forMethod · 0.80

Tested by

no test coverage detected