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 »

Classe « MongoClient »

Informations générales

Héritage

builtins.object
    BaseObject
        MongoClient

Définition

class MongoClient(BaseObject):

Description [extrait de MongoClient.__doc__]

    A client-side representation of a MongoDB cluster.

    Instances can represent either a standalone MongoDB server, a replica
    set, or a sharded cluster. Instances of this class are responsible for
    maintaining up-to-date state of the cluster, and possibly cache
    resources related to this, including background threads for monitoring,
    and connection pools.
    

Constructeur(s)

Signature du constructeur Description
__init__(self, host=None, port=None, document_class=<class 'dict'>, tz_aware=None, connect=None, type_registry=None, **kwargs) Client for a MongoDB instance, a replica set, or a set of mongoses. [extrait de __init__.__doc__]

Liste des attributs statiques

Nom de l'attribut Valeur
HOSTlocalhost
PORT27017

Liste des propriétés

Nom de la propriétéDescription
address(host, port) of the current standalone, primary, or mongos, or None. [extrait de __doc__]
arbitersArbiters in the replica set. [extrait de __doc__]
codec_optionsRead only access to the :class:`~bson.codec_options.CodecOptions` [extrait de __doc__]
event_listenersThe event listeners registered for this client. [extrait de __doc__]
is_locked**DEPRECATED**: Is this server locked? While locked, all write [extrait de __doc__]
is_mongosIf this client is connected to mongos. If the client is not [extrait de __doc__]
is_primaryIf this client is connected to a server that can accept writes. [extrait de __doc__]
local_threshold_msThe local threshold for this instance. [extrait de __doc__]
max_bson_sizeThe largest BSON object the connected server accepts in bytes. [extrait de __doc__]
max_idle_time_msThe maximum number of milliseconds that a connection can remain [extrait de __doc__]
max_message_sizeThe largest message the connected server accepts in bytes. [extrait de __doc__]
max_pool_sizeThe maximum allowable number of concurrent connections to each [extrait de __doc__]
max_write_batch_sizeThe maxWriteBatchSize reported by the server. [extrait de __doc__]
min_pool_sizeThe minimum required number of concurrent connections that the pool [extrait de __doc__]
nodesSet of all currently connected servers. [extrait de __doc__]
primaryThe (host, port) of the current primary of the replica set. [extrait de __doc__]
read_concernRead only access to the :class:`~pymongo.read_concern.ReadConcern` [extrait de __doc__]
read_preferenceRead only access to the read preference of this instance. [extrait de __doc__]
retry_readsIf this instance should retry supported write operations. [extrait de __doc__]
retry_writesIf this instance should retry supported write operations. [extrait de __doc__]
secondariesThe secondary members known to this client. [extrait de __doc__]
server_selection_timeoutThe server selection timeout for this instance in seconds. [extrait de __doc__]
topology_descriptionThe description of the connected MongoDB deployment. [extrait de __doc__]
write_concernRead only access to the :class:`~pymongo.write_concern.WriteConcern` [extrait de __doc__]

Liste des opérateurs

Signature de l'opérateur Description
__eq__(self, other)
__getitem__(self, name) Get a database by name. [extrait de __getitem__.__doc__]
__ne__(self, other)

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

__ge__, __gt__, __le__, __lt__

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
__enter__(self)
__exit__(self, exc_type, exc_val, exc_tb)
__getattr__(self, name) Get a database by name. [extrait de __getattr__.__doc__]
__hash__(self)
__iter__(self)
__next__(self)
__repr__(self)
close(self) Cleanup client resources and disconnect from MongoDB. [extrait de close.__doc__]
close_cursor(self, cursor_id, address=None) DEPRECATED - Send a kill cursors message soon with the given id. [extrait de close_cursor.__doc__]
database_names(self, session=None) **DEPRECATED**: Get a list of the names of all databases on the [extrait de database_names.__doc__]
drop_database(self, name_or_database, session=None) Drop a database. [extrait de drop_database.__doc__]
fsync(self, **kwargs) **DEPRECATED**: Flush all pending writes to datafiles. [extrait de fsync.__doc__]
get_database(self, name=None, codec_options=None, read_preference=None, write_concern=None, read_concern=None) Get a :class:`~pymongo.database.Database` with the given name and [extrait de get_database.__doc__]
get_default_database(self, default=None, codec_options=None, read_preference=None, write_concern=None, read_concern=None) Get the database named in the MongoDB connection URI. [extrait de get_default_database.__doc__]
kill_cursors(self, cursor_ids, address=None) DEPRECATED - Send a kill cursors message soon with the given ids. [extrait de kill_cursors.__doc__]
list_database_names(self, session=None) Get a list of the names of all databases on the connected server. [extrait de list_database_names.__doc__]
list_databases(self, session=None, **kwargs) Get a cursor over the databases of the connected server. [extrait de list_databases.__doc__]
next(self)
server_info(self, session=None) Get information about the MongoDB server we're connected to. [extrait de server_info.__doc__]
set_cursor_manager(self, manager_class) DEPRECATED - Set this client's cursor manager. [extrait de set_cursor_manager.__doc__]
start_session(self, causal_consistency=None, default_transaction_options=None, snapshot=False) Start a logical session. [extrait de start_session.__doc__]
unlock(self, session=None) **DEPRECATED**: Unlock a previously locked server. [extrait de unlock.__doc__]
watch(self, pipeline=None, full_document=None, resume_after=None, max_await_time_ms=None, batch_size=None, collation=None, start_at_operation_time=None, session=None, start_after=None) Watch changes on this cluster. [extrait de watch.__doc__]

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

__init_subclass__, __subclasshook__

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

__delattr__, __dir__, __format__, __getattribute__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__