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 ⇒ BSON::Document
Return the event payload for monitoring.
-
#replyable? ⇒ true
Get more messages require replies from the database.
Methods inherited from Message
#==, deserialize, #hash, #maybe_add_server_api, #maybe_compress, #maybe_decrypt, #maybe_encrypt, #maybe_inflate, #number_returned, #serialize, #set_request_id
Methods included from Id
Constructor Details
#initialize(database, collection, number_to_return, cursor_id) ⇒ GetMore
Creates a new getMore message
42 43 44 45 46 47 48 49 |
# 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 Method Details
#payload ⇒ BSON::Document
Return the event payload for monitoring.
59 60 61 62 63 64 65 66 |
# 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 |
#replyable? ⇒ true
Get more messages require replies from the database.
76 77 78 |
# File 'lib/mongo/protocol/get_more.rb', line 76 def replyable? true end |