Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Machine Learning
avec Scikit-Learn
Voir le programme détaillé
Classe « Cursor »

Méthode pymongo.cursor.Cursor.hint

Signature de la méthode hint

def hint(self, index: 'Optional[_Hint]') -> 'Cursor[_DocumentType]' 

Description

help(Cursor.hint)

Adds a 'hint', telling Mongo the proper index to use for the query.

Judicious use of hints can greatly improve query
performance. When doing a query on multiple fields (at least
one of which is indexed) pass the indexed field as a hint to
the query. Raises :class:`~pymongo.errors.OperationFailure` if the
provided hint requires an index that does not exist on this collection,
and raises :class:`~pymongo.errors.InvalidOperation` if this cursor has
already been used.

`index` should be an index as passed to
:meth:`~pymongo.collection.Collection.create_index`
(e.g. ``[('field', ASCENDING)]``) or the name of the index.
If `index` is ``None`` any existing hint for this query is
cleared. The last hint applied to this cursor takes precedence
over all others.

:param index: index to hint on (as an index specifier)


Vous êtes un professionnel et vous avez besoin d'une formation ? Calcul scientifique
avec Python
Voir le programme détaillé