class Mongo::Operation::Insert::Legacy

A MongoDB insert operation sent as a legacy wire protocol message.

@api private

@since 2.5.2

Private Instance Methods

get_result(connection, context, options = {}) click to toggle source
# File lib/mongo/operation/insert/legacy.rb, line 36
def get_result(connection, context, options = {})
  # This is a Mongo::Operation::Insert::Result
  Result.new(*dispatch_message(connection, context), @ids)
end
gle() click to toggle source
# File lib/mongo/operation/insert/legacy.rb, line 54
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/insert/legacy.rb, line 45
def message(connection)
  opts = if options(connection)[:continue_on_error]
    { :flags => [:continue_on_error] }
  else
    {}
  end
  Protocol::Insert.new(db_name, coll_name, documents, opts)
end
selector() click to toggle source
# File lib/mongo/operation/insert/legacy.rb, line 41
def selector
  send(IDENTIFIER).first
end