.update()
Updates the entries that match the provided filter with the provided callback. Updates all the entries if no filter is provided.
update(updateCallback, filter)
Parameter | Description |
updateCallback | Function to run for each entry returned by the filter |
filter | Callback (optional) Function to test each element of the array. Return a value that coerces to |
A new way of updating an entry's data from a collection was introduced in version 2.11.0.
Now, instead of using the Collection#update method, you can simply get or fetch the entry's data with Collection#get, Collection#fetch, Collection#getOrCreate or Collection#fetchOrCreate, update a property directly in the code and then use the new Data
#save
method.
See the examples below:
Last updated