This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Creates a bulk patch to modify the specified items. Unlike bulkUpdate()
, only the fields specified in the request are modified. Data that isn't explicitly modified remains unchanged.
The bulkPatch()
method builds a bulk patch to modify multiple data items in a collection. It returns a WixDataBulkPatch
object that contains the bulk patch definition, which you can further refine by chaining WixDataBulkPatch
methods onto it. These methods allow you to clear, set, and increment field values, as well as add or remove items from array fields. The methods are applied in the order in which they are chained.
Finally, to run the bulk patch, chain run()
as the last method.
Calling the bulkPatch()
method triggers the beforeUpdate()
and afterUpdate()
hooks for each patched item, if the hooks have been defined.
Notes:
insertReference()
or replaceReferences()
.bulkPatch()
fails and issues an error.data._updatedDate
field is updated to the current date and time.errors
array in the response returned by run()
contains a corresponding item with details about the error. Learn more about Wix Data Error Codes.
ID of the collection that contains the items to patch.
IDs of the data items to patch.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.