Package com.mongodb
Class BulkWriteError
java.lang.Object
com.mongodb.BulkWriteError
Represents an error for an item included in a bulk write operation, e.g. a duplicate key error
- Since:
- 2.12
- MongoDB documentation
- BulkWriteResult.writeErrors
-
Constructor Summary
ConstructorsConstructorDescriptionBulkWriteError
(int code, String message, com.mongodb.DBObject details, int index) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
getCode()
Gets the code associated with this error.com.mongodb.DBObject
Gets the details associated with this error.int
getIndex()
The index of the item in the bulk write operation with this error.Gets the message associated with this error.int
hashCode()
toString()
-
Constructor Details
-
BulkWriteError
Constructs a new instance.- Parameters:
code
- the error codemessage
- the error messagedetails
- details about the errorindex
- the index of the item in the bulk write operation that had this error
-
-
Method Details
-
getCode
public int getCode()Gets the code associated with this error.- Returns:
- the code
-
getMessage
Gets the message associated with this error.- Returns:
- the message
-
getDetails
public com.mongodb.DBObject getDetails()Gets the details associated with this error. This document will not be null, but may be empty.- Returns:
- the details
-
getIndex
public int getIndex()The index of the item in the bulk write operation with this error.- Returns:
- the index
-
equals
-
hashCode
public int hashCode() -
toString
-