Interface BulkWriteResult
public interface BulkWriteResult
Result of a
Bulk write execution. Exposes counts for inserted, modified, deleted, and upserted documents, and
whether the operation was acknowledged by the server. Abstracts over both single-collection
(BulkWriteResult) and multi-collection (ClientBulkWriteResult) driver results.- Since:
- 5.1
- Author:
- Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether the bulk write was acknowledged by the server.longReturns the number of documents deleted.static BulkWriteResultfrom(com.mongodb.bulk.BulkWriteResult result) Creates aBulkWriteResultfrom a MongoDB driverBulkWriteResult.static BulkWriteResultfrom(com.mongodb.client.model.bulk.ClientBulkWriteResult result) Creates aBulkWriteResultfrom a MongoDB driverClientBulkWriteResult.longReturns the number of documents inserted.longReturns the number of documents that matched the query criteria in update, replace, or remove operations.longReturns the number of documents modified by update operations.longReturns the number of documents upserted.
-
Method Details
-
from
Creates aBulkWriteResultfrom a MongoDB driverClientBulkWriteResult.- Parameters:
result- the driver result; must not be null.- Returns:
- a new
BulkWriteResultwrapping the given result.
-
from
Creates aBulkWriteResultfrom a MongoDB driverBulkWriteResult.- Parameters:
result- the driver result; must not be null.- Returns:
- a new
BulkWriteResultwrapping the given result.
-
insertCount
long insertCount()Returns the number of documents inserted.- Returns:
- the insert count.
-
modifiedCount
long modifiedCount()Returns the number of documents modified by update operations.- Returns:
- the modified count.
-
deleteCount
long deleteCount()Returns the number of documents deleted.- Returns:
- the delete count.
-
upsertCount
long upsertCount()Returns the number of documents upserted.- Returns:
- the upsert count.
-
acknowledged
boolean acknowledged()Returns whether the bulk write was acknowledged by the server.- Returns:
- true if acknowledged.
-
matchedCount
long matchedCount()Returns the number of documents that matched the query criteria in update, replace, or remove operations.- Returns:
- the matched count.
-