Class Moped::Protocol::GetMore
In: lib/moped/protocol/get_more.rb
Parent: Object

The Protocol class for retrieving more documents from a cursor.

@since 1.0.0

Methods

Included Modules

Message

Attributes

collection  [R]  @!attribute collection
  @return [ String ] The collection to query.

@!attribute database

  @return [ String ] The database to query
database  [R]  @!attribute collection
  @return [ String ] The collection to query.

@!attribute database

  @return [ String ] The database to query

Public Class methods

Create a new GetMore command. The database and collection arguments are joined together to set the full_collection_name.

@example Get more results using database default limit.

  GetMore.new("moped", "people", 29301021, 0)

@example Get more results using custom limit.

  GetMore.new("moped", "people", 29301021, 10)

@example Get more with a request id.

  GetMore.new("moped", "people", 29301021, 10, request_id: 123)

@param [ String ] database The database name. @param [ String ] collection The collection name. @param [ Integer ] cursor_id The id of the cursor. @param [ Integer ] limit The number of documents to limit. @param [ Hash ] options The get more options.

@option options [ Integer ] :request_id The operation‘s request id.

@since 1.0.0

Public Instance methods

Determine if the provided reply message is a failure with respect to a get more operation.

@example Is the reply a query failure?

  get_more.failure?(reply)

@param [ Reply ] reply The reply to the get more.

@return [ true, false ] If the reply is a failure.

@since 2.0.0

Get the exception specific to a failure of this particular operation.

@example Get the failure exception.

  get_more.failure_exception(document)

@param [ Moped::Protocol::Reply ] reply The reply from the database.

@return [ Moped::Errors::CursorNotFound ] The failure exception.

@since 2.0.0

Provide the value that will be logged when the get more runs.

@example Provide the log inspection.

  get_more.log_inspect

@return [ String ] The string value for logging.

@since 1.0.0

Get the code for a get more operation.

@example Get the operation code.

  get_more.op_code

@return [ Integer ] OP_GETMORE operation code (2005).

@since 1.0.0

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

Take the provided reply and return the expected results to api consumers.

@example Get the expected results of the reply.

  get_more.results(reply)

@param [ Moped::Protocol::Reply ] reply The reply from the database.

@return [ Moped::Protocol::Reply ] The reply.

@since 2.0.0

[Validate]