Method: Moped::Protocol::GetMore#initialize

Defined in:
lib/moped/protocol/get_more.rb

#initialize(database, collection, cursor_id, limit, options = {}) ⇒ GetMore

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

Examples:

Get more results using database default limit.

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

Get more results using custom limit.

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

Get more with a request id.

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

Parameters:

  • database (String)

    The database name.

  • collection (String)

    The collection name.

  • cursor_id (Integer)

    The id of the cursor.

  • limit (Integer)

    The number of documents to limit.

  • options (Hash) (defaults to: {})

    The get more options.

Options Hash (options):

  • :request_id (Integer)

    The operation’s request id.

Since:

  • 1.0.0



100
101
102
103
104
105
106
107
# File 'lib/moped/protocol/get_more.rb', line 100

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