

def hint(self, index):
    "Adds a 'hint', telling Mongo the proper index to use for the query.\n\n        Judicious use of hints can greatly improve query\n        performance. When doing a query on multiple fields (at least\n        one of which is indexed) pass the indexed field as a hint to\n        the query. Hinting will not do anything if the corresponding\n        index does not exist. Raises\n        :class:`~pymongo.errors.InvalidOperation` if this cursor has\n        already been used.\n\n        `index` should be an index as passed to\n        :meth:`~pymongo.collection.Collection.create_index`\n        (e.g. ``[('field', ASCENDING)]``). If `index`\n        is ``None`` any existing hints for this query are cleared. The\n        last hint applied to this cursor takes precedence over all\n        others.\n\n        :Parameters:\n          - `index`: index to hint on (as an index specifier)\n        "
    self.__check_okay_to_chain()
    if (index is None):
        self.__hint = None
        return self
    self.__hint = helpers._index_document(index)
    return self

dataset/ETHPy150Open blynch/CloudMemeBackend/pymongo/cursor.py Cursor.hint/original