Class: Mongo::Protocol::KillCursors
- Defined in:
- lib/mongo/protocol/kill_cursors.rb
Overview
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.
Defined Under Namespace
Classes: Upconverter
Constant Summary
Constants inherited from Message
Message::BATCH_SIZE, Message::COLLECTION, Message::LIMIT, Message::MAX_MESSAGE_SIZE, Message::ORDERED, Message::Q
Instance Attribute Summary
Attributes inherited from Message
Instance Method Summary collapse
-
#initialize(collection, database, cursor_ids) ⇒ KillCursors
constructor
Creates a new KillCursors message.
-
#payload ⇒ BSON::Document
Return the event payload for monitoring.
Methods inherited from Message
#==, deserialize, #hash, #maybe_add_server_api, #maybe_compress, #maybe_decrypt, #maybe_encrypt, #maybe_inflate, #number_returned, #replyable?, #serialize, #set_request_id
Methods included from Id
Constructor Details
#initialize(collection, database, cursor_ids) ⇒ KillCursors
Creates a new KillCursors message
37 38 39 40 41 42 43 |
# File 'lib/mongo/protocol/kill_cursors.rb', line 37 def initialize(collection, database, cursor_ids) @database = database @cursor_ids = cursor_ids @id_count = @cursor_ids.size @upconverter = Upconverter.new(collection, cursor_ids) super end |
Instance Method Details
#payload ⇒ BSON::Document
Return the event payload for monitoring.
53 54 55 56 57 58 59 60 |
# File 'lib/mongo/protocol/kill_cursors.rb', line 53 def payload BSON::Document.new( command_name: 'killCursors', database_name: @database, command: upconverter.command, request_id: request_id, ) end |