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

Public Member Functions

def __init__ (self, tag_sets=None, max_staleness=-1, hedge=None)
 
def __call__ (self, selection)
 
- Public Member Functions inherited from _ServerMode
def __init__ (self, mode, tag_sets=None, max_staleness=-1, hedge=None)
 
def name (self)
 
def mongos_mode (self)
 
def document (self)
 
def mode (self)
 
def tag_sets (self)
 
def max_staleness (self)
 
def hedge (self)
 
def min_wire_version (self)
 
def __repr__ (self)
 
def __eq__ (self, other)
 
def __ne__ (self, other)
 
def __getstate__ (self)
 
def __setstate__ (self, value)
 

Additional Inherited Members

- Data Fields inherited from _ServerMode
 mode
 
 tag_sets
 
 max_staleness
 
 hedge
 

Detailed Description

Nearest read preference.

* When directly connected to one mongod queries are allowed to standalone
  servers, to a replica set primary, or to replica set secondaries.
* When connected to a mongos queries are distributed among all members of
  a shard.
* When connected to a replica set queries are distributed among all
  members.

:Parameters:
  - `tag_sets`: The :attr:`~tag_sets` for this read preference.
  - `max_staleness`: (integer, in seconds) The maximum estimated
    length of time a replica set secondary can fall behind the primary in
    replication before it will no longer be selected for operations.
    Default -1, meaning no maximum. If it is set, it must be at least
    90 seconds.
  - `hedge`: The :attr:`~hedge` for this read preference.

.. versionchanged:: 3.11
   Added ``hedge`` parameter.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  tag_sets = None,
  max_staleness = -1,
  hedge = None 
)

Member Function Documentation

◆ __call__()

def __call__ (   self,
  selection 
)
Apply this read preference to Selection.

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