Package com.mongodb.client.result
Class DeleteResult
- java.lang.Object
-
- com.mongodb.client.result.DeleteResult
-
public abstract class DeleteResult extends Object
The result of a delete operation. If the delete was unacknowledged, thenwasAcknowledged
will return false and all other methods will throwUnsupportedOperationException
.- Since:
- 3.0
- See Also:
WriteConcern.UNACKNOWLEDGED
-
-
Constructor Summary
Constructors Constructor Description DeleteResult()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static DeleteResult
acknowledged(long deletedCount)
Create an acknowledged DeleteResultabstract long
getDeletedCount()
Gets the number of documents deleted.static DeleteResult
unacknowledged()
Create an unacknowledged DeleteResultabstract boolean
wasAcknowledged()
Returns true if the write was acknowledged.
-
-
-
Method Detail
-
wasAcknowledged
public abstract boolean wasAcknowledged()
Returns true if the write was acknowledged.- Returns:
- true if the write was acknowledged
-
getDeletedCount
public abstract long getDeletedCount()
Gets the number of documents deleted.- Returns:
- the number of documents deleted
-
acknowledged
public static DeleteResult acknowledged(long deletedCount)
Create an acknowledged DeleteResult- Parameters:
deletedCount
- the number of documents deleted- Returns:
- an acknowledged DeleteResult
-
unacknowledged
public static DeleteResult unacknowledged()
Create an unacknowledged DeleteResult- Returns:
- an unacknowledged DeleteResult
-
-