Class: Mongo::Protocol::Delete
- Defined in:
- lib/mongo/protocol/delete.rb
Overview
MongoDB Wire protocol Delete message.
This is a client request message that is sent to the server in order to delete selected documents in the specified namespace.
The operation, by default, operates on many documents. Setting the :single_remove
flag allows for a single matching document to be removed.
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(database, collection, selector, options = {}) ⇒ Delete
constructor
Creates a new Delete message.
-
#payload ⇒ Hash
Return the event payload for monitoring.
Methods inherited from Message
#==, deserialize, #hash, #replyable?, #serialize, #set_request_id
Constructor Details
#initialize(database, collection, selector, options = {}) ⇒ Delete
Creates a new Delete message
43 44 45 46 47 48 49 |
# File 'lib/mongo/protocol/delete.rb', line 43 def initialize(database, collection, selector, = {}) @database = database @namespace = "#{database}.#{collection}" @selector = selector @flags = [:flags] || [] @upconverter = Upconverter.new(collection, selector, ) end |
Instance Method Details
#payload ⇒ Hash
Return the event payload for monitoring.
59 60 61 62 63 64 65 66 |
# File 'lib/mongo/protocol/delete.rb', line 59 def payload { command_name: 'delete', database_name: @database, command: upconverter.command, request_id: request_id } end |