class Mongo::Cursor::Builder::KillCursorsCommand

Generates a specification for a kill cursors 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.

KillCursorsCommand.new(cursor)

@param [ Cursor ] cursor The cursor.

@since 2.2.0

# File lib/mongo/cursor/builder/kill_cursors_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.

kill_cursors_command.specification

@return [ Hash ] The spec.

@since 2.2.0

# File lib/mongo/cursor/builder/kill_cursors_command.rb, line 50
def specification
  { selector: kill_cursors_command, db_name: database.name }
end

Private Instance Methods

kill_cursors_command() click to toggle source
# File lib/mongo/cursor/builder/kill_cursors_command.rb, line 56
def kill_cursors_command
  { :killCursors => collection_name, :cursors => [ cursor.id ] }
end