class Mongo::Operation::Insert::Legacy
A MongoDB insert 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::Insert::Result
] The operation result.
@since 2.5.2
# File lib/mongo/operation/insert/legacy.rb, line 41 def execute(server) result = Result.new(dispatch_message(server), @ids) process_result(result, server) result.validate! end
Private Instance Methods
gle()
click to toggle source
# File lib/mongo/operation/insert/legacy.rb, line 58 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/insert/legacy.rb, line 53 def message(server) opts = !!options[:continue_on_error] ? { :flags => [:continue_on_error] } : {} Protocol::Insert.new(db_name, coll_name, documents, opts) end
selector()
click to toggle source
# File lib/mongo/operation/insert/legacy.rb, line 49 def selector send(IDENTIFIER).first end