Class Mongo::Operation::Insert::Result
In: lib/mongo/operation/insert/result.rb
Parent: Operation::Result

Defines custom behavior of results for an insert.

According to the CRUD spec, reporting the inserted ids is optional. It can be added to this class later, if needed.

@since 2.0.0

Methods

Attributes

inserted_ids  [R]  Get the ids of the inserted documents.

@since 2.0.0

Public Class methods

Initialize a new result.

@example Instantiate the result.

  Result.new(replies, inserted_ids)

@param [ Array<Protocol::Message> | nil ] replies The wire protocol replies, if any. @param [ Array<Object> ] ids The ids of the inserted documents.

@since 2.0.0

Public Instance methods

Gets the id of the document inserted.

@example Get id of the document inserted.

  result.inserted_id

@return [ Object ] The id of the document inserted.

@since 2.0.0

[Validate]