public abstract class BulkWriteResult
extends java.lang.Object
| Constructor and Description |
|---|
BulkWriteResult() |
| Modifier and Type | Method and Description |
|---|---|
static BulkWriteResult |
acknowledged(int insertedCount,
int matchedCount,
int removedCount,
java.lang.Integer modifiedCount,
java.util.List<BulkWriteUpsert> upserts)
Create an acknowledged BulkWriteResult
|
static BulkWriteResult |
acknowledged(WriteRequest.Type type,
int count,
java.lang.Integer modifiedCount,
java.util.List<BulkWriteUpsert> upserts)
Create an acknowledged BulkWriteResult
|
static BulkWriteResult |
acknowledged(WriteRequest.Type type,
int count,
java.util.List<BulkWriteUpsert> upserts)
Create an acknowledged BulkWriteResult
|
abstract int |
getDeletedCount()
Returns the number of documents deleted by the write operation.
|
abstract int |
getInsertedCount()
Returns the number of documents inserted by the write operation.
|
abstract int |
getMatchedCount()
Returns the number of documents matched by updates or replacements in the write operation.
|
abstract int |
getModifiedCount()
Returns the number of documents modified by the write operation.
|
abstract java.util.List<BulkWriteUpsert> |
getUpserts()
Gets an unmodifiable list of upserted items, or the empty list if there were none.
|
abstract boolean |
isModifiedCountAvailable()
Deprecated.
no longer needed since all supported server versions support modified count
|
static BulkWriteResult |
unacknowledged()
Create an unacknowledged BulkWriteResult
|
abstract boolean |
wasAcknowledged()
Returns true if the write was acknowledged.
|
public abstract boolean wasAcknowledged()
WriteConcern.UNACKNOWLEDGEDpublic abstract int getInsertedCount()
java.lang.UnsupportedOperationException - if the write was unacknowledged.WriteConcern.UNACKNOWLEDGEDpublic abstract int getMatchedCount()
java.lang.UnsupportedOperationException - if the write was unacknowledged.WriteConcern.UNACKNOWLEDGEDpublic abstract int getDeletedCount()
java.lang.UnsupportedOperationException - if the write was unacknowledged.WriteConcern.UNACKNOWLEDGED@Deprecated public abstract boolean isModifiedCountAvailable()
This method now always returns true, as modified count is available since MongoDB 2.6.
java.lang.UnsupportedOperationException - if the write was unacknowledged.WriteConcern.UNACKNOWLEDGED,
getModifiedCount()public abstract int getModifiedCount()
WriteConcern.UNACKNOWLEDGEDpublic abstract java.util.List<BulkWriteUpsert> getUpserts()
java.lang.UnsupportedOperationException - if the write was unacknowledged.WriteConcern.UNACKNOWLEDGEDpublic static BulkWriteResult acknowledged(WriteRequest.Type type, int count, java.util.List<BulkWriteUpsert> upserts)
type - the type of the writecount - the number of documents matchedupserts - the list of upsertspublic static BulkWriteResult acknowledged(WriteRequest.Type type, int count, java.lang.Integer modifiedCount, java.util.List<BulkWriteUpsert> upserts)
type - the type of the writecount - the number of documents matchedmodifiedCount - the number of documents modified, which may be null if the server was not able to provide the countupserts - the list of upsertspublic static BulkWriteResult acknowledged(int insertedCount, int matchedCount, int removedCount, java.lang.Integer modifiedCount, java.util.List<BulkWriteUpsert> upserts)
insertedCount - the number of documents inserted by the write operationmatchedCount - the number of documents matched by the write operationremovedCount - the number of documents removed by the write operationmodifiedCount - the number of documents modified, which may not be nullupserts - the list of upsertspublic static BulkWriteResult unacknowledged()
Copyright © 2010 - 2023 Adobe. All Rights Reserved