class Mongo::Operation::Delete::Legacy
A MongoDB delete operation sent as a legacy wire protocol message.
@api private
@since 2.5.2
Private Instance Methods
gle()
click to toggle source
# File lib/mongo/operation/delete/legacy.rb, line 50 def gle wc = write_concern || WriteConcern.get(WriteConcern::DEFAULT) if gle_message = wc.get_last_error Protocol::Query.new( db_name, Database::COMMAND, gle_message, options.merge(limit: -1) ) end end
message(connection)
click to toggle source
# File lib/mongo/operation/delete/legacy.rb, line 44 def message(connection) selector = selector(connection) opts = (selector[Operation::LIMIT] || 0) <= 0 ? {} : { :flags => [ :single_remove ] } Protocol::Delete.new(db_name, coll_name, selector[Operation::Q], opts) end
selector(connection)
click to toggle source
# File lib/mongo/operation/delete/legacy.rb, line 35 def selector(connection) # This returns the first delete. # The driver only puts one delete into the list normally, so this # doesn't discard operations. send(IDENTIFIER).first.tap do |selector| validate_find_options(connection, selector) end end