class Mongo::Operation::Insert::OpMsg

A MongoDB insert operation sent as an op message.

@api private

@since 2.5.2

Private Instance Methods

get_result(connection, context, options = {}) click to toggle source
# File lib/mongo/operation/insert/op_msg.rb, line 35
def get_result(connection, context, options = {})
  # This is a Mongo::Operation::Insert::Result
  Result.new(*dispatch_message(connection, context), @ids)
end
message(connection) click to toggle source
# File lib/mongo/operation/insert/op_msg.rb, line 49
def message(connection)
  section = Protocol::Msg::Section1.new(IDENTIFIER, send(IDENTIFIER))
  Protocol::Msg.new(flags, {}, command(connection), section)
end
selector(connection) click to toggle source
# File lib/mongo/operation/insert/op_msg.rb, line 40
def selector(connection)
  {
    insert: coll_name,
    Protocol::Msg::DATABASE_IDENTIFIER => db_name,
    ordered: ordered?,
    comment: spec[:comment],
  }.compact
end