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 :

Module « pymongo.cursor »

Classe « Cursor »

Informations générales

Héritage

builtins.object
    Cursor

Définition

class Cursor(builtins.object):

Description [extrait de Cursor.__doc__]

A cursor / iterator over Mongo query results.
    

Constructeur(s)

Signature du constructeur Description
__init__(self, collection, filter=None, projection=None, skip=0, limit=0, no_cursor_timeout=False, cursor_type=0, sort=None, allow_partial_results=False, oplog_replay=False, modifiers=None, batch_size=0, manipulate=True, collation=None, hint=None, max_scan=None, max_time_ms=None, max=None, min=None, return_key=False, show_record_id=False, snapshot=False, comment=None, session=None, allow_disk_use=None) Create a new cursor. [extrait de __init__.__doc__]

Liste des propriétés

Nom de la propriétéDescription
addressThe (host, port) of the server used, or None. [extrait de __doc__]
aliveDoes this cursor have the potential to return more data? [extrait de __doc__]
collectionThe :class:`~pymongo.collection.Collection` that this [extrait de __doc__]
cursor_idReturns the id of the cursor [extrait de __doc__]
retrievedThe number of documents retrieved so far. [extrait de __doc__]
sessionThe cursor's :class:`~pymongo.client_session.ClientSession`, or None. [extrait de __doc__]

Liste des opérateurs

Signature de l'opérateur Description
__getitem__(self, index) Get a single document or a slice of documents from this cursor. [extrait de __getitem__.__doc__]

Opérateurs hérités de la classe object

__eq__, __ge__, __gt__, __le__, __lt__, __ne__

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées
Signature de la méthodeDescription
__copy__(self) Support function for `copy.copy()`. [extrait de __copy__.__doc__]
__deepcopy__(self, memo) Support function for `copy.deepcopy()`. [extrait de __deepcopy__.__doc__]
__del__(self)
__enter__(self)
__exit__(self, exc_type, exc_val, exc_tb)
__iter__(self)
__next__(self) Advance the cursor. [extrait de next.__doc__]
add_option(self, mask) Set arbitrary query flags using a bitmask. [extrait de add_option.__doc__]
allow_disk_use(self, allow_disk_use) Specifies whether MongoDB can use temporary disk files while [extrait de allow_disk_use.__doc__]
batch_size(self, batch_size) Limits the number of documents returned in one batch. Each batch [extrait de batch_size.__doc__]
clone(self) Get a clone of this cursor. [extrait de clone.__doc__]
close(self) Explicitly close / kill this cursor. [extrait de close.__doc__]
collation(self, collation) Adds a :class:`~pymongo.collation.Collation` to this query. [extrait de collation.__doc__]
comment(self, comment) Adds a 'comment' to the cursor. [extrait de comment.__doc__]
count(self, with_limit_and_skip=False) **DEPRECATED** - Get the size of the results set for this query. [extrait de count.__doc__]
distinct(self, key) Get a list of distinct values for `key` among all documents [extrait de distinct.__doc__]
explain(self) Returns an explain plan record for this cursor. [extrait de explain.__doc__]
hint(self, index) Adds a 'hint', telling Mongo the proper index to use for the query. [extrait de hint.__doc__]
limit(self, limit) Limits the number of results to be returned by this cursor. [extrait de limit.__doc__]
max(self, spec) Adds ``max`` operator that specifies upper bound for specific index. [extrait de max.__doc__]
max_await_time_ms(self, max_await_time_ms) Specifies a time limit for a getMore operation on a [extrait de max_await_time_ms.__doc__]
max_scan(self, max_scan) **DEPRECATED** - Limit the number of documents to scan when [extrait de max_scan.__doc__]
max_time_ms(self, max_time_ms) Specifies a time limit for a query operation. If the specified [extrait de max_time_ms.__doc__]
min(self, spec) Adds ``min`` operator that specifies lower bound for specific index. [extrait de min.__doc__]
next(self) Advance the cursor. [extrait de next.__doc__]
remove_option(self, mask) Unset arbitrary query flags using a bitmask. [extrait de remove_option.__doc__]
rewind(self) Rewind this cursor to its unevaluated state. [extrait de rewind.__doc__]
skip(self, skip) Skips the first `skip` results of this cursor. [extrait de skip.__doc__]
sort(self, key_or_list, direction=None) Sorts this cursor's results. [extrait de sort.__doc__]
where(self, code) Adds a `$where`_ clause to this query. [extrait de where.__doc__]

Méthodes héritées de la classe object

__delattr__, __dir__, __format__, __getattribute__, __hash__, __init_subclass__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__