Docs Menu

Class UpdateResult

On this page

  • io.realm.mongodb.mongo.result
  • Constructors
  • Method Summary
  • Inherited Methods
  • Constructor Detail
  • Method Detail
  • getMatchedCount
  • getModifiedCount
  • getUpsertedId
java.lang.Object
io.realm.mongodb.mongo.result.UpdateResult

The result of an update operation.

Constructor and Description
long matchedCount,
long modifiedCount,
BsonValue upsertedId
)

Constructs a result.

Modifier and Type
Method and Description
public long

Returns the number of documents matched by the query.

public long

Returns the number of documents modified.

public BsonValue

If the replace resulted in an inserted document, gets the _id of the inserted document, otherwise null.

  • Methods inherited from class java.lang.Object : getClass , hashCode , equals , clone , toString , notify , notifyAll , wait , wait , wait , finalize
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.
public long getMatchedCount ()

Returns the number of documents matched by the query.

Returns

the number of documents matched.

public long getModifiedCount ()

Returns the number of documents modified.

Returns

the number of documents modified.

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.

←  Class InsertOneResultio.realm.mongodb.push →
Give Feedback
© 2022 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.