Package io.realm.mongodb.mongo.result
Class UpdateResult
- java.lang.Object
-
- io.realm.mongodb.mongo.result.UpdateResult
-
public class UpdateResult extends Object
The result of an update operation.
-
-
Constructor Summary
Constructors Constructor Description UpdateResult(long matchedCount, long modifiedCount, BsonValue upsertedId)
Constructs a result.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getMatchedCount()
Returns the number of documents matched by the query.long
getModifiedCount()
Returns the number of documents modified.BsonValue
getUpsertedId()
If the replace resulted in an inserted document, gets the _id of the inserted document, otherwise null.
-
-
-
Constructor Detail
-
UpdateResult
public UpdateResult(long matchedCount, long modifiedCount, BsonValue upsertedId)
Constructs a result.- Parameters:
matchedCount
- the number of documents matched by the query.modifiedCount
- the number of documents modified.upsertedId
- the _id of the inserted document if the replace resulted in an inserted document, otherwise null.
-
-
Method Detail
-
getMatchedCount
public long getMatchedCount()
Returns the number of documents matched by the query.- Returns:
- the number of documents matched.
-
getModifiedCount
public long getModifiedCount()
Returns the number of documents modified.- Returns:
- the number of documents modified.
-
getUpsertedId
@Nullable public BsonValue getUpsertedId()
If the replace resulted in an inserted document, gets the _id of the inserted document, otherwise null.- Returns:
- if the replace resulted in an inserted document, the _id of the inserted document, otherwise null.
-
-