Package com.mongodb

Class WriteConcernResult


  • @Deprecated(since="2021-05-27")
    public abstract class WriteConcernResult
    extends java.lang.Object
    Deprecated.
    Usage of this API is not supported in AEM as a Cloud Service.
    The result of a successful write operation. If the write was unacknowledged, then wasAcknowledged will return false and all other methods will throw MongoUnacknowledgedWriteException.
    Since:
    3.0
    See Also:
    WriteConcern.UNACKNOWLEDGED
    • Constructor Detail

      • WriteConcernResult

        public WriteConcernResult()
        Deprecated.
    • Method Detail

      • wasAcknowledged

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

        public abstract int getCount()
        Deprecated.
        Returns the number of documents affected by the write operation.
        Returns:
        the number of documents affected by the write operation
        Throws:
        java.lang.UnsupportedOperationException - if the write was unacknowledged.
      • isUpdateOfExisting

        public abstract boolean isUpdateOfExisting()
        Deprecated.
        Returns true if the write was an update of an existing document.
        Returns:
        true if the write was an update of an existing document
        Throws:
        java.lang.UnsupportedOperationException - if the write was unacknowledged.
      • getUpsertedId

        @Nullable
        public abstract BsonValue getUpsertedId()
        Deprecated.
        Returns the value of _id if this write resulted in an upsert.
        Returns:
        the value of _id if this write resulted in an upsert.
        Throws:
        java.lang.UnsupportedOperationException - if the write was unacknowledged.
      • acknowledged

        public static WriteConcernResult acknowledged​(int count,
                                                      boolean isUpdateOfExisting,
                                                      @Nullable
                                                      BsonValue upsertedId)
        Deprecated.
        Create an acknowledged WriteConcernResult
        Parameters:
        count - the count of matched documents
        isUpdateOfExisting - whether an existing document was updated
        upsertedId - if an upsert resulted in an inserted document, this is the _id of that document. This may be null
        Returns:
        an acknowledged WriteConcernResult
      • unacknowledged

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