class Mongo::Operation::Delete::OpMsg
A MongoDB delete operation sent as an op message.
@api private
@since 2.5.2
Public Instance Methods
execute(server)
click to toggle source
Execute the operation.
@example
operation.execute(server)
@param [ Mongo::Server
] server The server to send the operation to.
@return [ Mongo::Operation::Delete::Result
] The operation result.
@since 2.5.2
# File lib/mongo/operation/delete/op_msg.rb, line 40 def execute(server) result = Result.new(dispatch_message(server)) process_result(result, server) rescue Mongo::Error::SocketError => e e.send(:add_label, Mongo::Error::TRANSIENT_TRANSACTION_ERROR_LABEL) if session.in_transaction? raise e end
Private Instance Methods
message(server)
click to toggle source
# File lib/mongo/operation/delete/op_msg.rb, line 56 def message(server) section = { type: 1, payload: { identifier: IDENTIFIER, sequence: send(IDENTIFIER) } } Protocol::Msg.new(flags, {}, command(server), section) end
selector(server)
click to toggle source
# File lib/mongo/operation/delete/op_msg.rb, line 50 def selector(server) { delete: coll_name, Protocol::Msg::DATABASE_IDENTIFIER => db_name, ordered: ordered? } end