class Mongo::Operation::Update::Legacy
A MongoDB update operation sent as a legacy wire protocol 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::Update::Result ] The operation result.
@since 2.5.2
# File lib/mongo/operation/update/legacy.rb, line 40 def execute(server) result = Result.new(dispatch_message(server)) process_result(result, server) result.validate! end
Private Instance Methods
gle()
click to toggle source
# File lib/mongo/operation/update/legacy.rb, line 66 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(server)
click to toggle source
# File lib/mongo/operation/update/legacy.rb, line 52 def message(server) flags = [] flags << :multi_update if selector[Operation::MULTI] flags << :upsert if selector[Operation::UPSERT] Protocol::Update.new( db_name, coll_name, selector[Operation::Q], selector[Operation::U], flags.empty? ? {} : { flags: flags } ) end
selector()
click to toggle source
# File lib/mongo/operation/update/legacy.rb, line 48 def selector send(IDENTIFIER).first end