Class: Mongo::Protocol::GetMore
Relationships & Source Files | |
Namespace Children | |
Classes:
| |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Message
|
|
Instance Chain:
|
|
Inherits: |
Mongo::Protocol::Message
|
Defined in: | lib/mongo/protocol/get_more.rb |
Overview
MongoDB Wire protocol getMore message.
This is a client request message that is sent to the server in order to retrieve additional documents from a cursor that has already been instantiated.
The operation requires that you specify the database and collection name as well as the cursor id because cursors are scoped to a namespace.
Constant Summary
-
OP_CODE =
The operation code required to specify a getMore message.
2005
Serializers
- Included
HEADER_PACK, INT32_PACK, INT64_PACK, NULL, ZERO
Message
- Inherited
Class Method Summary
-
.new(database, collection, number_to_return, cursor_id) ⇒ GetMore
constructor
Creates a new getMore message.
Message
- Inherited
.deserialize | Deserializes messages from an IO stream. |
.new | :nodoc: |
.deserialize_array | Deserializes an array of fields in a message. |
.deserialize_field | Deserializes a single field in a message. |
.deserialize_header | Deserializes the header of the message. |
.field | A method for declaring a message field. |
.fields | A class method for getting the fields for a message class. |
Instance Attribute Summary
-
#replyable? ⇒ true
readonly
Get more messages require replies from the database.
- #cursor_id ⇒ Fixnum rw private
- #namespace ⇒ String rw private
- #number_to_return ⇒ Fixnum rw private
Message
- Inherited
#replyable? | The default for messages is not to require a reply after sending a message to the server. |
#request_id | Returns the request id for the message. |
Instance Method Summary
-
#payload ⇒ BSON::Document
Return the event payload for monitoring.
Message
- Inherited
#== | Tests for equality between two wire protocol messages by comparing class and field values. |
#eql? | Alias for Message#==. |
#hash | Creates a hash from the values of the fields of a message. |
#maybe_add_server_api, | |
#maybe_compress | Compress the message, if supported by the wire protocol used and if the command being sent permits compression. |
#maybe_decrypt | Possibly decrypt this message with libmongocrypt. |
#maybe_encrypt | Possibly encrypt this message with libmongocrypt. |
#maybe_inflate | Inflate a message if it is compressed. |
#number_returned | Default number returned value for protocol messages. |
#serialize | Serializes message into bytes that can be sent on the wire. |
#set_request_id | Generates a request id for a message. |
#to_s | Alias for Message#serialize. |
#compress_if_possible | Compress the message, if the command being sent permits compression. |
#fields | A method for getting the fields for a message class. |
#merge_sections, | |
#serialize_fields | Serializes message fields into a buffer. |
#serialize_header | Serializes the header of the message consisting of 4 32bit integers. |
Constructor Details
.new(database, collection, number_to_return, cursor_id) ⇒ GetMore
Creates a new getMore message
# File 'lib/mongo/protocol/get_more.rb', line 42
def initialize(database, collection, number_to_return, cursor_id) @database = database @namespace = "#{database}.#{collection}" @number_to_return = number_to_return @cursor_id = cursor_id @upconverter = Upconverter.new(collection, cursor_id, number_to_return) super end
Instance Attribute Details
#cursor_id ⇒ Fixnum
(rw, private)
# File 'lib/mongo/protocol/get_more.rb', line 105
field :cursor_id, Int64
#namespace ⇒ String
(rw, private)
# File 'lib/mongo/protocol/get_more.rb', line 97
field :namespace, CString
#number_to_return ⇒ Fixnum
(rw, private)
# File 'lib/mongo/protocol/get_more.rb', line 101
field :number_to_return, Int32
#replyable? ⇒ true
(readonly)
Get more messages require replies from the database.
# File 'lib/mongo/protocol/get_more.rb', line 76
def replyable? true end
Instance Method Details
#payload ⇒ BSON::Document
Return the event payload for monitoring.
# File 'lib/mongo/protocol/get_more.rb', line 59
def payload BSON::Document.new( command_name: 'getMore', database_name: @database, command: upconverter.command, request_id: request_id ) end