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

Public Member Functions

def __init__ (self, flags, cursor_id, number_returned, documents)
 
def raw_response (self, cursor_id=None)
 
def unpack_response (self, cursor_id=None, codec_options=_UNICODE_REPLACE_CODEC_OPTIONS, user_fields=None, legacy_response=False)
 
def command_response (self)
 
def raw_command_response (self)
 
def more_to_come (self)
 
def unpack (cls, msg)
 

Data Fields

 flags
 
 cursor_id
 
 number_returned
 
 documents
 

Static Public Attributes

 UNPACK_FROM
 
 OP_CODE
 

Detailed Description

A MongoDB OP_REPLY response message.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  flags,
  cursor_id,
  number_returned,
  documents 
)

Member Function Documentation

◆ command_response()

def command_response (   self)
Unpack a command response.

◆ more_to_come()

def more_to_come (   self)
Is the moreToCome bit set on this response?

◆ raw_command_response()

def raw_command_response (   self)
Return the bytes of the command response.

◆ raw_response()

def raw_response (   self,
  cursor_id = None 
)
Check the response header from the database, without decoding BSON.

Check the response for errors and unpack.

Can raise CursorNotFound, NotMasterError, ExecutionTimeout, or
OperationFailure.

:Parameters:
  - `cursor_id` (optional): cursor_id we sent to get this response -
    used for raising an informative exception when we get cursor id not
    valid at server response.

◆ unpack()

def unpack (   cls,
  msg 
)
Construct an _OpReply from raw bytes.

◆ unpack_response()

def unpack_response (   self,
  cursor_id = None,
  codec_options = _UNICODE_REPLACE_CODEC_OPTIONS,
  user_fields = None,
  legacy_response = False 
)
Unpack a response from the database and decode the BSON document(s).

Check the response for errors and unpack, returning a dictionary
containing the response data.

Can raise CursorNotFound, NotMasterError, ExecutionTimeout, or
OperationFailure.

:Parameters:
  - `cursor_id` (optional): cursor_id we sent to get this response -
    used for raising an informative exception when we get cursor id not
    valid at server response
  - `codec_options` (optional): an instance of
    :class:`~bson.codec_options.CodecOptions`

Field Documentation

◆ cursor_id

cursor_id

◆ documents

documents

◆ flags

flags

◆ number_returned

number_returned

◆ OP_CODE

OP_CODE
static

◆ UNPACK_FROM

UNPACK_FROM
static

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