OpenQuizz
Une application de gestion des contenus pédagogiques
WriteConcern Class Reference
Inheritance diagram for WriteConcern:
Collaboration diagram for WriteConcern:

Public Member Functions

def __init__ (self, w=None, wtimeout=None, j=None, fsync=None)
 
def is_server_default (self)
 
def document (self)
 
def acknowledged (self)
 
def __repr__ (self)
 
def __eq__ (self, other)
 
def __ne__ (self, other)
 

Detailed Description

WriteConcern

:Parameters:
    - `w`: (integer or string) Used with replication, write operations
      will block until they have been replicated to the specified number
      or tagged set of servers. `w=<integer>` always includes the replica
      set primary (e.g. w=3 means write to the primary and wait until
      replicated to **two** secondaries). **w=0 disables acknowledgement
      of write operations and can not be used with other write concern
      options.**
    - `wtimeout`: (integer) Used in conjunction with `w`. Specify a value
      in milliseconds to control how long to wait for write propagation
      to complete. If replication does not complete in the given
      timeframe, a timeout exception is raised.
    - `j`: If ``True`` block until write operations have been committed
      to the journal. Cannot be used in combination with `fsync`. Prior
      to MongoDB 2.6 this option was ignored if the server was running
      without journaling. Starting with MongoDB 2.6 write operations will
      fail with an exception if this option is used when the server is
      running without journaling.
    - `fsync`: If ``True`` and the server is running without journaling,
      blocks until the server has synced all data files to disk. If the
      server is running with journaling, this acts the same as the `j`
      option, blocking until write operations have been committed to the
      journal. Cannot be used in combination with `j`.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  w = None,
  wtimeout = None,
  j = None,
  fsync = None 
)

Member Function Documentation

◆ __eq__()

def __eq__ (   self,
  other 
)

◆ __ne__()

def __ne__ (   self,
  other 
)

◆ __repr__()

def __repr__ (   self)

◆ acknowledged()

def acknowledged (   self)
If ``True`` write operations will wait for acknowledgement before
returning.

◆ document()

def document (   self)
The document representation of this write concern.

.. note::
  :class:`WriteConcern` is immutable. Mutating the value of
  :attr:`document` does not mutate this :class:`WriteConcern`.

◆ is_server_default()

def is_server_default (   self)
Does this WriteConcern match the server default.

The documentation for this class was generated from the following file: