Exception: Mongo::Error::BulkWriteError

Inherits:
Mongo::Error
  • Object
show all
Defined in:
lib/mongo/error/bulk_write_error.rb

Overview

Exception raised if there are write errors upon executing the bulk operation.

Since:

  • 2.0.0

Constant Summary

Constants inherited from Mongo::Error

BAD_VALUE, CODE, CURSOR_NOT_FOUND, ERR, ERRMSG, ERROR, UNKNOWN_ERROR, WRITE_CONCERN_ERROR, WRITE_CONCERN_ERRORS, WRITE_ERRORS

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ BulkWriteError

Instantiate the new exception.

Examples:

Instantiate the exception.

Mongo::Error::BulkWriteFailure.new(response)

Parameters:

  • result (Hash)

    A processed response from the server reporting results of the operation.

Since:

  • 2.0.0



36
37
38
# File 'lib/mongo/error/bulk_write_error.rb', line 36

def initialize(result)
  @result = result
end

Instance Attribute Details

#resultBSON::Document (readonly)

Returns result The error result.

Returns:

  • (BSON::Document)

    result The error result.

Since:

  • 2.0.0



25
26
27
# File 'lib/mongo/error/bulk_write_error.rb', line 25

def result
  @result
end