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

Defines custom behavior of results for an insert when sent as part of a bulk write.

@since 2.0.0

Methods

inserted_id   n_inserted   new  

Included Modules

Aggregatable

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

Gets the number of documents inserted.

@example Get the number of documents inserted.

  result.n_inserted

@return [ Integer ] The number of documents inserted.

@since 2.0.0

[Validate]