Class UpdateDescription
On this page
io.realm.mongodb.mongo.events
Indicates which fields have been modified in a given update operation.
Method Summary
Modifier and Type | Method and Description |
---|---|
public static UpdateDescription | Find the diff between two documents. |
public boolean | |
public static UpdateDescription | 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 | hashCode () |
public boolean | isEmpty () Determines whether this update description is empty. |
public UpdateDescription | 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. |
Inherited Methods
Methods inherited from class java.lang.Object :
getClass
,hashCode
,equals
,clone
,toString
,notify
,notifyAll
,wait
,wait
,wait
,finalize
Method Detail
diff
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
Returns a description of the updated fields and removed keys between the documents. |
equals
fromBsonDocument
Converts an update description BSON document from a MongoDB Change Event into an UpdateDescription object. Parameters
Returns the converted UpdateDescription |
getRemovedFields
public Collection getRemovedFields () |
---|
Returns a List containing the field names that have been removed in the corresponding update. Returns the removed fields names. |
getUpdatedFields
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. |
hashCode
isEmpty
public boolean isEmpty () |
---|
Determines whether this update description is empty. Returns true if the update description is empty, false otherwise |
merge
Unilaterally merge an update description into this update description. Parameters
Returns this merged update description |
toBsonDocument
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 |
toUpdateDocument
public BsonDocument toUpdateDocument () |
---|
Convert this update description to an update document. Returns an update document with the appropriate $set and $unset documents. |