.update()
Updates the entries that match the provided filter with the provided callback. Updates all the entries if no filter is provided.
Last updated
Updates the entries that match the provided filter with the provided callback. Updates all the entries if no filter is provided.
Last updated
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:
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 true
to keep the element, or to false
otherwise
Returns
Description
The updated entries