Methods
- callback
- Type:
callback(dictionary, changeset)
Function to be called when a change event occurs. Each callback will only be called once per event, regardless of the number of times it was added. The callback has two arguments:
- dictionary: the dictionary instance that changed
- changeset: an object of array of keys changed (
deletions
,insertions
, andmodifications
)
-
Error
If
callback
is not a function.
- key
- Type:
string
The key to be removed.
-
Error
If not inside a write transaction
- callback
- Type:
callback(Realm.Dictionary, Realm.Dictionary.Changeset)
Function that was previously added as a listener through the
addListener
method.-
Error
If
callback
is not a function.
- key
- Type:
string
The key to be added or set
- value
The value
-
Error
If not inside a write transaction or if value violates type constraints
Add a listener callback
.
Parameters:
Throws:
Remove a key from the dictionary. It is also possible to use the keyword delete
.
Parameters:
Throws:
Remove all event listeners.
Remove the listener callback
.
Parameters:
Throws:
Add a key with a value or update value if key exists.