public abstract class WriteConcernResult
extends java.lang.Object
wasAcknowledged
will return false and all
other methods will throw MongoUnacknowledgedWriteException
.WriteConcern.UNACKNOWLEDGED
Constructor and Description |
---|
WriteConcernResult() |
Modifier and Type | Method and Description |
---|---|
static WriteConcernResult |
acknowledged(int count,
boolean isUpdateOfExisting,
BsonValue upsertedId)
Create an acknowledged WriteConcernResult
|
abstract int |
getCount()
Returns the number of documents affected by the write operation.
|
abstract BsonValue |
getUpsertedId()
Returns the value of _id if this write resulted in an upsert.
|
abstract boolean |
isUpdateOfExisting()
Returns true if the write was an update of an existing document.
|
static WriteConcernResult |
unacknowledged()
Create an unacknowledged WriteConcernResult
|
abstract boolean |
wasAcknowledged()
Returns true if the write was acknowledged.
|
public abstract boolean wasAcknowledged()
public abstract int getCount()
java.lang.UnsupportedOperationException
- if the write was unacknowledged.public abstract boolean isUpdateOfExisting()
java.lang.UnsupportedOperationException
- if the write was unacknowledged.@Nullable public abstract BsonValue getUpsertedId()
java.lang.UnsupportedOperationException
- if the write was unacknowledged.public static WriteConcernResult acknowledged(int count, boolean isUpdateOfExisting, @Nullable BsonValue upsertedId)
count
- the count of matched documentsisUpdateOfExisting
- whether an existing document was updatedupsertedId
- if an upsert resulted in an inserted document, this is the _id of that document. This may be nullpublic static WriteConcernResult unacknowledged()
Copyright © 2010 - 2020 Adobe. All Rights Reserved