The Protocol class for retrieving more documents from a cursor.
@example Get more results using database default limit
insert = GetMore.new "moped", "people", 29301021, 0
@example Get more results using custom limit
insert = Insert.new "moped", "people", 29301021, 10
@example Setting the request id
insert = Insert.new "moped", "people", 29301021, 10, request_id: 123
Create a new GetMore command. The database and collection arguments are joined together to set the full_collection_name.
@example
GetMore.new "moped", "users", 29301021, 10, request_id: 123
# File lib/moped/protocol/get_more.rb, line 65 def initialize(database, collection, cursor_id, limit, options = {}) @database = database @collection = collection @full_collection_name = "#{database}.#{collection}" @cursor_id = cursor_id @limit = limit @request_id = options[:request_id] end
# File lib/moped/protocol/get_more.rb, line 75 def log_inspect type = "GET_MORE" "%-12s database=%s collection=%s limit=%s cursor_id=%s" % [type, database, collection, limit, cursor_id] end
@return [Number] OP_GETMORE operation code (2005)
# File lib/moped/protocol/get_more.rb, line 50 def op_code 2005 end
Receive replies to the message.
@example Receive replies.
message.receive_replies(connection)
@param [ Connection ] connection The connection.
@return [ Protocol::Reply ] The reply.
@since 1.0.0
# File lib/moped/protocol/get_more.rb, line 90 def receive_replies(connection) connection.read end
Generated with the Darkfish Rdoc Generator 2.