public abstract class BulkWriteResult extends Object
Constructor | Description |
---|---|
BulkWriteResultโ() |
Modifier and Type | Method | Description |
---|---|---|
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 int |
getRemovedCountโ() |
Returns the number of documents removed by the write operation.
|
abstract List<BulkWriteUpsert> |
getUpsertsโ() |
Gets an unmodifiable list of upserted items, or the empty list if there were none.
|
abstract boolean |
isAcknowledgedโ() |
Returns true if the write was acknowledged.
|
abstract boolean |
isModifiedCountAvailableโ() |
Returns true if the server was able to provide a count of modified documents.
|
public abstract boolean isAcknowledgedโ()
WriteConcern.UNACKNOWLEDGED
public abstract int getInsertedCountโ()
UnsupportedOperationException
- if the write was unacknowledged.WriteConcern.UNACKNOWLEDGED
public abstract int getMatchedCountโ()
UnsupportedOperationException
- if the write was unacknowledged.WriteConcern.UNACKNOWLEDGED
public abstract int getRemovedCountโ()
UnsupportedOperationException
- if the write was unacknowledged.WriteConcern.UNACKNOWLEDGED
public abstract boolean isModifiedCountAvailableโ()
getModifiedCount
method will throw UnsupportedOperationException
.UnsupportedOperationException
- if the write was unacknowledged.WriteConcern.UNACKNOWLEDGED
,
getModifiedCount()
public abstract int getModifiedCountโ()
Returns the number of documents modified by the write operation. This only applies to updates or replacements, and will only count documents that were actually changed; for example, if you set the value of some field , and the field already has that value, that will not count as a modification.
If the server is not able to provide a count of modified documents (which can happen if the server is not at least version 2.6),
then this method will throw an UnsupportedOperationException
UnsupportedOperationException
- if the write was unacknowledged or if no modified count is availableWriteConcern.UNACKNOWLEDGED
,
isModifiedCountAvailable()
public abstract List<BulkWriteUpsert> getUpsertsโ()
UnsupportedOperationException
- if the write was unacknowledged.WriteConcern.UNACKNOWLEDGED