class Mongo::Protocol::KillCursors
MongoDB Wire protocol KillCursors message.
This is a client request message that is sent to the server in order to kill a number of cursors.
@api semipublic
Attributes
upconverter[R]
Public Class Methods
new(collection, database, cursor_ids)
click to toggle source
Creates a new KillCursors message
@example Kill the cursor on the server with id 1.
KillCursors.new([1])
@param [ Mongo::Database ] collection The collection. @param [ Mongo::Database ] database The database. @param [ Array<Fixnum> ] cursor_ids The cursor ids to kill.
# File lib/mongo/protocol/kill_cursors.rb, line 34 def initialize(collection, database, cursor_ids) @database = database @cursor_ids = cursor_ids @id_count = @cursor_ids.size @upconverter = Upconverter.new(collection, cursor_ids) end
Public Instance Methods
payload()
click to toggle source
Return the event payload for monitoring.
@example Return the event payload.
message.payload
@return [ Hash ] The event payload.
@since 2.1.0
# File lib/mongo/protocol/kill_cursors.rb, line 49 def payload { command_name: 'killCursors', database_name: @database, command: upconverter.command, request_id: request_id } end
Private Instance Methods
op_code()
click to toggle source
The operation code required to specify KillCursors
message.
@return [Fixnum] the operation code.
# File lib/mongo/protocol/kill_cursors.rb, line 64 def op_code 2007 end