Docs Menu
Docs Home
/ /
Atlas Device SDKs
/ / /

Class UpdateDescription

On this page

  • io.realm.mongodb.mongo.events
  • Method Summary
  • Inherited Methods
  • Method Detail
  • diff
  • equals
  • fromBsonDocument
  • getRemovedFields
  • getUpdatedFields
  • hashCode
  • isEmpty
  • merge
  • toBsonDocument
  • toUpdateDocument
java.lang.Object
io.realm.mongodb.mongo.events.UpdateDescription

Indicates which fields have been modified in a given update operation.

Modifier and Type
Method and Description
public static UpdateDescription
BsonDocument beforeDocument,
BsonDocument afterDocument
)

Find the diff between two documents.

public boolean
public static UpdateDescription
BsonDocument document
)

Converts an update description BSON document from a MongoDB Change Event into an UpdateDescription object.

public Collection

Returns a List containing the field names that have been removed in the corresponding update.

public BsonDocument

Returns a BsonDocument containing keys and values representing (respectively) the fields that have changed in the corresponding update and their new values.

public int
public boolean

Determines whether this update description is empty.

UpdateDescription otherDescription
)

Unilaterally merge an update description into this update description.

public BsonDocument

Converts this update description to its document representation as it would appear in a MongoDB Change Event.

public BsonDocument

Convert this update description to an update document.

  • Methods inherited from class java.lang.Object : getClass , hashCode , equals , clone , toString , notify , notifyAll , wait , wait , wait , finalize

public static UpdateDescription diff (
BsonDocument beforeDocument,
BsonDocument afterDocument
)

Find the diff between two documents.NOTE: This does not do a full diff on [BsonArray]. If there is an inequality between the old and new array, the old array will simply be replaced by the new one.

Parameters

  • beforeDocument - original document

  • afterDocument - document to diff on

Returns

a description of the updated fields and removed keys between the documents.

public boolean equals (
Object obj
)

Overrides

equals in class Object

BsonDocument document
)

Converts an update description BSON document from a MongoDB Change Event into an UpdateDescription object.

Parameters

  • document - the

Returns

the converted UpdateDescription

Returns a List containing the field names that have been removed in the corresponding update.

Returns

the removed fields names.

public BsonDocument getUpdatedFields ()

Returns a BsonDocument containing keys and values representing (respectively) the fields that have changed in the corresponding update and their new values.

Returns

the updated field names and their new values.

public int hashCode ()

Overrides

hashCode in class Object

public boolean isEmpty ()

Determines whether this update description is empty.

Returns

true if the update description is empty, false otherwise

UpdateDescription otherDescription
)

Unilaterally merge an update description into this update description.

Parameters

  • otherDescription - the update description to merge into this

Returns

this merged update description

public BsonDocument toBsonDocument ()

Converts this update description to its document representation as it would appear in a MongoDB Change Event.

Returns

the update description document as it would appear in a change event

public BsonDocument toUpdateDocument ()

Convert this update description to an update document.

Returns

an update document with the appropriate $set and $unset documents.

Back

BaseChangeEvent.OperationType