Method: Mongo::Operation::Insert::Result#initialize

Defined in:
lib/mongo/operation/insert/result.rb

#initialize(replies, connection_description, connection_global_id, ids, context: nil) ⇒ Result

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initialize a new result.

Examples:

Instantiate the result.

Result.new(replies, inserted_ids)

Parameters:

  • replies (Array<Protocol::Message> | nil)

    The wire protocol replies, if any.

  • connection_description (Server::Description)

    Server description of the server that performed the operation that this result is for.

  • connection_global_id (Integer)

    Global id of the connection on which the operation that this result is for was performed.

  • ids (Array<Object>)

    The ids of the inserted documents.

  • context (Operation::Context | nil) (defaults to: nil)

    the operation context that was active when this result was produced.

Since:

  • 2.0.0



55
56
57
58
# File 'lib/mongo/operation/insert/result.rb', line 55

def initialize(replies, connection_description, connection_global_id, ids, context: nil)
  super(replies, connection_description, connection_global_id, context: context)
  @inserted_ids = ids
end