public abstract class UpdateResult
extends java.lang.Object
wasAcknowledged
will return false and all other
methods will throw UnsupportedOperationException
.WriteConcern.UNACKNOWLEDGED
Constructor and Description |
---|
UpdateResult() |
Modifier and Type | Method and Description |
---|---|
static UpdateResult |
acknowledged(long matchedCount,
java.lang.Long modifiedCount,
BsonValue upsertedId)
Create an acknowledged UpdateResult
|
abstract long |
getMatchedCount()
Gets the number of documents matched by the query.
|
abstract long |
getModifiedCount()
Gets the number of documents modified by the update.
|
abstract BsonValue |
getUpsertedId()
If the replace resulted in an inserted document, gets the _id of the inserted document, otherwise null.
|
abstract boolean |
isModifiedCountAvailable()
Deprecated.
no longer needed since all supported server versions support modified count
|
static UpdateResult |
unacknowledged()
Create an unacknowledged UpdateResult
|
abstract boolean |
wasAcknowledged()
Returns true if the write was acknowledged.
|
public abstract boolean wasAcknowledged()
public abstract long getMatchedCount()
@Deprecated public abstract boolean isModifiedCountAvailable()
This method now always returns true, as modified count is available since MongoDB 2.6.
public abstract long getModifiedCount()
@Nullable public abstract BsonValue getUpsertedId()
public static UpdateResult acknowledged(long matchedCount, @Nullable java.lang.Long modifiedCount, @Nullable BsonValue upsertedId)
matchedCount
- the number of documents matchedmodifiedCount
- the number of documents modifiedupsertedId
- if the replace resulted in an inserted document, the id of the inserted documentpublic static UpdateResult unacknowledged()
Copyright © 2010 - 2023 Adobe. All Rights Reserved