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 ? Programmation Python
Les fondamentaux
Voir le programme détaillé
Classe « Cursor »

Méthode pymongo.cursor.Cursor.distinct

Signature de la méthode distinct

def distinct(self, key: 'str') -> 'list' 

Description

help(Cursor.distinct)

Get a list of distinct values for `key` among all documents
in the result set of this query.

Raises :class:`TypeError` if `key` is not an instance of
:class:`str`.

The :meth:`distinct` method obeys the
:attr:`~pymongo.collection.Collection.read_preference` of the
:class:`~pymongo.collection.Collection` instance on which
:meth:`~pymongo.collection.Collection.find` was called.

:param key: name of key for which we want to get the distinct values

.. seealso:: :meth:`pymongo.collection.Collection.distinct`


Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les fondamentaux
Voir le programme détaillé