class Mongo::Cursor::Builder::GetMoreCommand
Generates a specification for a get more command.
@since 2.2.0
Attributes
cursor[R]
@return [ Cursor ] cursor The cursor.
Public Class Methods
new(cursor)
click to toggle source
Create the new builder.
@example Create the builder.
GetMoreCommand.new(cursor)
@param [ Cursor ] cursor The cursor.
@since 2.2.0
# File lib/mongo/cursor/builder/get_more_command.rb, line 38 def initialize(cursor) @cursor = cursor end
Public Instance Methods
specification()
click to toggle source
Get the specification.
@example Get the specification.
get_more_command.specification
@return [ Hash ] The spec.
@since 2.2.0
# File lib/mongo/cursor/builder/get_more_command.rb, line 50 def specification { selector: get_more_command, db_name: database.name } end
Private Instance Methods
get_more_command()
click to toggle source
# File lib/mongo/cursor/builder/get_more_command.rb, line 56 def get_more_command command = { :getMore => cursor.id, :collection => collection_name } command[:batchSize] = batch_size if batch_size # If the max_await_time_ms option is set, then we set maxTimeMS on # the get more command. if view.respond_to?(:max_await_time_ms) if view.max_await_time_ms && view.options[:await_data] command[:maxTimeMS] = view.max_await_time_ms end end command end