Realm.Sync.ChangeEvent

Change information passed when receiving sync 'change' events.

A ChangeEvent object can only be used within the callback which it is supplied to, and cannot be stored for use later. If the callback returns a promise, the ChangeEvent will remain valid until that promise is resolved (and no further notifications for that same Realm will be made until it is resolved). The Realms supplied by the change event do not need to be explicitly closed.

changes

The changed objects for all added, removed, and modified objects in the changed Realm. This object is a hashmap of object types to arrays of objects for all objects changed between the two reported realm versions. The objects in insertions and newModifications are referencing the new realm version (realm()) while deletions and oldModifications refer to the objects in the old realm (oldRealm()).

Type:
object
Example:
{
  MyObject: {
    insertions:    [objects...],
    deletions:     [objects...],
    newModifications: [objects...],
    oldModifications: [objects...]
  },
  MyOtherObject:
    ...
}
oldRealm

The modified Realm prior to any of the changes being applied. This can be used in combination with the changed object keys to read the old values of any objects which were modified.

Type:
Realm
path

The virtual path of the changed Realm. This is the portion of the URL of the synced Realm after the protocol and the host name.

Type:
string
realm

The changed realm, with the changes applied.

Type:
Realm