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

Method _set_hint

pymongo/asynchronous/cursor.py:760–768  ·  view source on GitHub ↗
(self, index: Optional[_Hint])

Source from the content-addressed store, hash-verified

758 return await anext(c)
759
760 def _set_hint(self, index: Optional[_Hint]) -> None:
761 if index is None:
762 self._hint = None
763 return
764
765 if isinstance(index, str):
766 self._hint = index
767 else:
768 self._hint = helpers_shared._index_document(index)
769
770 def hint(self, index: Optional[_Hint]) -> AsyncCursor[_DocumentType]:
771 """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