Class UpdateResults


  • public class UpdateResults
    extends java.lang.Object
    This class holds various metrics about the results of an update operation.
    • Constructor Detail

      • UpdateResults

        public UpdateResults​(com.mongodb.WriteResult wr)
        Creates an UpdateResults
        Parameters:
        wr - the WriteResult from the driver.
    • Method Detail

      • getInsertedCount

        public int getInsertedCount()
        Returns:
        number inserted; this should be either 0/1.
      • getNewId

        public java.lang.Object getNewId()
        Returns:
        the new _id field if an insert/upsert was performed
      • getUpdatedCount

        public int getUpdatedCount()
        Returns:
        number updated
      • getUpdatedExisting

        public boolean getUpdatedExisting()
        Returns:
        true if updated, false if inserted or none effected
      • getWriteResult

        public com.mongodb.WriteResult getWriteResult()
        Returns:
        the underlying data
      • getN

        protected int getN()
        Returns:
        number of affected documents
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object