Class: Mongo::Protocol::GetMore
- 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.
Defined Under Namespace
Classes: Upconverter
Constant Summary
Constants inherited from Message
Message::BATCH_SIZE, Message::COLLECTION, Message::LIMIT, Message::MAX_MESSAGE_SIZE, Message::ORDERED, Message::Q
Instance Attribute Summary
Attributes inherited from Message
Instance Method Summary collapse
-
#initialize(database, collection, number_to_return, cursor_id) ⇒ GetMore
constructor
Creates a new GetMore message.
-
#payload ⇒ Hash
Return the event payload for monitoring.
-
#replyable? ⇒ true
Get more messages require replies from the database.
Methods inherited from Message
#==, deserialize, #hash, #serialize, #set_request_id
Constructor Details
#initialize(database, collection, number_to_return, cursor_id) ⇒ GetMore
Creates a new GetMore message
39 40 41 42 43 44 45 |
# File 'lib/mongo/protocol/get_more.rb', line 39 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) end |
Instance Method Details
#payload ⇒ Hash
Return the event payload for monitoring.
55 56 57 58 59 60 61 62 |
# File 'lib/mongo/protocol/get_more.rb', line 55 def payload { command_name: 'getMore', database_name: @database, command: upconverter.command, request_id: request_id } end |
#replyable? ⇒ true
Get more messages require replies from the database.
72 73 74 |
# File 'lib/mongo/protocol/get_more.rb', line 72 def replyable? true end |