Package com.mongodb.client.result
Class DeleteResult
java.lang.Object
com.mongodb.client.result.DeleteResult
The result of a delete operation. If the delete was unacknowledged, then
wasAcknowledged
will return false and all other methods
will throw UnsupportedOperationException
.- Since:
- 3.0
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic DeleteResult
acknowledged
(long deletedCount) Create an acknowledged DeleteResultabstract long
Gets the number of documents deleted.static DeleteResult
Create an unacknowledged DeleteResultabstract boolean
Returns true if the write was acknowledged.
-
Constructor Details
-
DeleteResult
public DeleteResult()
-
-
Method Details
-
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
Create an acknowledged DeleteResult- Parameters:
deletedCount
- the number of documents deleted- Returns:
- an acknowledged DeleteResult
-
unacknowledged
Create an unacknowledged DeleteResult- Returns:
- an unacknowledged DeleteResult
-