Class BulkWriteError

java.lang.Object
com.mongodb.WriteError
com.mongodb.bulk.BulkWriteError

public class BulkWriteError extends WriteError
Represents an error for an item included in a bulk write operation, e.g. a duplicate key error
Since:
3.0
  • Constructor Details

    • BulkWriteError

      public BulkWriteError(int code, String message, BsonDocument details, int index)
      Constructs a new instance.
      Parameters:
      code - the error code
      message - the error message
      details - details about the error
      index - the index of the item in the bulk write operation that had this error
  • Method Details

    • getIndex

      public int getIndex()
      The index of the item in the bulk write operation with this error.
      Returns:
      the index
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class WriteError
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class WriteError
    • toString

      public String toString()
      Overrides:
      toString in class WriteError