Class MongoClientBulkWriteResult


  • public class MongoClientBulkWriteResult
    extends Object
    Result propagated from mongodb driver bulk write result.
    Author:
    sschmitt
    • Field Detail

      • INSERTED_COUNT

        public static final String INSERTED_COUNT
        Constant to be used when storing and retrieving Json for documents inserted.
        See Also:
        Constant Field Values
      • MATCHED_COUNT

        public static final String MATCHED_COUNT
        Constant to be used when storing and retrieving Json for documents matched.
        See Also:
        Constant Field Values
      • MODIFIED_COUNT

        public static final String MODIFIED_COUNT
        Constant to be used when storing and retrieving Json for documents modified.
        See Also:
        Constant Field Values
      • DELETED_COUNT

        public static final String DELETED_COUNT
        Constant to be used when storing and retrieving Json for documents deleted.
        See Also:
        Constant Field Values
      • UPSERTS

        public static final String UPSERTS
        Constant to be used when storing and retrieving Json for upsert information.
        See Also:
        Constant Field Values
      • INSERTS

        public static final String INSERTS
        Constant to be used when storing and retrieving Json for insert information.
        See Also:
        Constant Field Values
      • ID

        public static final String ID
        Constant to be used when storing and retrieving Json for ID of upsert information.
        See Also:
        Constant Field Values
      • INDEX

        public static final String INDEX
        Constant to be used when storing and retrieving Json for index of upsert information.
        See Also:
        Constant Field Values
      • DEFAULT_INSERTED_COUNT

        public static final long DEFAULT_INSERTED_COUNT
        The default value is 0, signifying no document was inserted
        See Also:
        Constant Field Values
      • DEFAULT_MATCHED_COUNT

        public static final long DEFAULT_MATCHED_COUNT
        The default value is 0, signifying no document was matched
        See Also:
        Constant Field Values
      • DEFAULT_DELETED_COUNT

        public static final long DEFAULT_DELETED_COUNT
        The default value is 0, signifying no document was deleted
        See Also:
        Constant Field Values
      • DEFAULT_MODIFIED_COUNT

        public static final long DEFAULT_MODIFIED_COUNT
        The default value is 0, signifying no document was modified
        See Also:
        Constant Field Values
    • Constructor Detail

      • MongoClientBulkWriteResult

        public MongoClientBulkWriteResult()
        Default constructor
      • MongoClientBulkWriteResult

        public MongoClientBulkWriteResult​(long insertedCount,
                                          long matchedCount,
                                          long deletedCount,
                                          long modifiedCount,
                                          List<JsonObject> upserts,
                                          List<JsonObject> inserts)
        Constructor to specify the result of the bulk write operation.
        Parameters:
        insertedCount - the number of inserted documents
        matchedCount - the number of documents matched by update or replacements
        deletedCount - the number of deleted documents
        modifiedCount - the number of modified documents
        upserts - the list of upserted items
        inserts - the list of inserted items
      • MongoClientBulkWriteResult

        public MongoClientBulkWriteResult​(MongoClientBulkWriteResult other)
        Copy constructor
        Parameters:
        other -
      • MongoClientBulkWriteResult

        public MongoClientBulkWriteResult​(JsonObject mongoClientBulkWriteResultJson)
        Constructor from JSON
        Parameters:
        mongoClientBulkWriteResultJson -
    • Method Detail

      • toJson

        public JsonObject toJson()
        Convert to JSON
        Returns:
        the JSON
      • getInsertedCount

        public long getInsertedCount()
        Returns the number of inserted documents
        Returns:
        the inserted documents
      • getMatchedCount

        public long getMatchedCount()
        Returns the number of matched documents
        Returns:
        the matched documents
      • getDeletedCount

        public long getDeletedCount()
        Returns the number of deleted documents
        Returns:
        the deleted documents
      • getModifiedCount

        public long getModifiedCount()
        Returns the number of modified documents
        Returns:
        the modified documents
      • getUpserts

        public List<JsonObject> getUpserts()
        An unmodifiable list of upsert data. Each entry has the index of the request that lead to the upsert, and the generated ID of the upsert.
        Returns:
        an unmodifiable list of upsert info
      • getInserts

        public List<JsonObject> getInserts()
        An unmodifiable list of inserts data. Each entry has the index of the request that lead to the insert, and the generated ID of the insert.
        Returns:
        an unmodifiable list of insert info
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object