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

Method _set_hint

pymongo/synchronous/cursor.py:758–766  ·  view source on GitHub ↗
(self, index: Optional[_Hint])

Source from the content-addressed store, hash-verified

756 return next(c)
757
758 def _set_hint(self, index: Optional[_Hint]) -> None:
759 if index is None:
760 self._hint = None
761 return
762
763 if isinstance(index, str):
764 self._hint = index
765 else:
766 self._hint = helpers_shared._index_document(index)
767
768 def hint(self, index: Optional[_Hint]) -> Cursor[_DocumentType]:
769 """Adds a 'hint', telling Mongo the proper index to use for the query.

Callers 2

__init__Method · 0.95
hintMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected