Class UpdateResult

java.lang.Object
com.mongodb.client.result.UpdateResult

@Deprecated(since="2021-05-27") public abstract class UpdateResult extends Object
Deprecated.
Usage of this API is not supported in AEM as a Cloud Service.
The result of an update operation. If the update was unacknowledged, then wasAcknowledged will return false and all other methods will throw UnsupportedOperationException.
Since:
3.0
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    acknowledged(long matchedCount, Long modifiedCount, BsonValue upsertedId)
    Deprecated.
    Create an acknowledged UpdateResult
    abstract long
    Deprecated.
    Gets the number of documents matched by the query.
    abstract long
    Deprecated.
    Gets the number of documents modified by the update.
    abstract BsonValue
    Deprecated.
    If the replace resulted in an inserted document, gets the _id of the inserted document, otherwise null.
    abstract boolean
    Deprecated.
    no longer needed since all supported server versions support modified count
    Deprecated.
    Create an unacknowledged UpdateResult
    abstract boolean
    Deprecated.
    Returns true if the write was acknowledged.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • UpdateResult

      public UpdateResult()
      Deprecated.
  • Method Details

    • wasAcknowledged

      public abstract boolean wasAcknowledged()
      Deprecated.
      Returns true if the write was acknowledged.
      Returns:
      true if the write was acknowledged
    • getMatchedCount

      public abstract long getMatchedCount()
      Deprecated.
      Gets the number of documents matched by the query.
      Returns:
      the number of documents matched
    • isModifiedCountAvailable

      @Deprecated public abstract boolean isModifiedCountAvailable()
      Deprecated.
      no longer needed since all supported server versions support modified count
      Gets a value indicating whether the modified count is available.

      This method now always returns true, as modified count is available since MongoDB 2.6.

      Returns:
      true if the modified count is available
    • getModifiedCount

      public abstract long getModifiedCount()
      Deprecated.
      Gets the number of documents modified by the update.
      Returns:
      the number of documents modified
    • getUpsertedId

      @Nullable public abstract BsonValue getUpsertedId()
      Deprecated.
      If the replace resulted in an inserted document, gets the _id of the inserted document, otherwise null.
      Returns:
      if the replace resulted in an inserted document, the _id of the inserted document, otherwise null
    • acknowledged

      public static UpdateResult acknowledged(long matchedCount, @Nullable Long modifiedCount, @Nullable BsonValue upsertedId)
      Deprecated.
      Create an acknowledged UpdateResult
      Parameters:
      matchedCount - the number of documents matched
      modifiedCount - the number of documents modified
      upsertedId - if the replace resulted in an inserted document, the id of the inserted document
      Returns:
      an acknowledged UpdateResult
    • unacknowledged

      public static UpdateResult unacknowledged()
      Deprecated.
      Create an unacknowledged UpdateResult
      Returns:
      an unacknowledged UpdateResult