appendToArray( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Refines a patch operation to append the specified value to the specified array field.

Method Declaration
Copy
function appendToArray(field: string, value: any): WixDataBulkPatch;
Method Parameters
fieldstringRequired

Array field to append the specified value to. Nested fields can be specified using dot notation. For example: address.street.


valueanyRequired

Value to append to the specified array field.

Returns
Return Type:WixDataBulkPatch
Append to array
JavaScript
import { items } from "@wix/data"; async function appendToArray() { const results = await items .bulkPatch("BlogPosts", [ "fb071093-9a40-432d-ae1f-2e5966fecbfa", "9fe1a67f-fc60-4e99-8898-3f9e719ca62f", ]) .appendToArray("tags", "travel") .appendToArray("tags", "lifestyle") .run(); const updated = results.updated; // 2 const errors = results.errors; // [] }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

incrementField( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Refines a patch operation to increment the specified field value by the specified parameter.

Method Declaration
Copy
function incrementField(field: string, by: number): WixDataBulkPatch;
Method Parameters
fieldstringRequired

Field whose value is incremented. Nested fields can be specified using dot notation. For example: address.street.


bynumberRequired

Value by which to increment the specified field. To decrement, specify a negative value.

Returns
Return Type:WixDataBulkPatch
Increment field
JavaScript
import { items } from "@wix/data"; async function incrementField() { const results = await items .bulkPatch("BlogPosts", [ "fb071093-9a40-432d-ae1f-2e5966fecbfa", "9fe1a67f-fc60-4e99-8898-3f9e719ca62f", ]) .incrementField("viewCount", 1) .run(); const updated = results.updated; // 2 const errors = results.errors; // [] }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

removeField( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Refines a patch operation to clear the specified field.

Method Declaration
Copy
function removeField(field: string): WixDataBulkPatch;
Method Parameters
fieldstringRequired

Field whose value is cleared. Nested fields can be specified using dot notation. For example: address.street.

Returns
Return Type:WixDataBulkPatch
Remove field
JavaScript
import { items } from "@wix/data"; async function removeField() { const results = await items .bulkPatch("BlogPosts", [ "fb071093-9a40-432d-ae1f-2e5966fecbfa", "9fe1a67f-fc60-4e99-8898-3f9e719ca62f", ]) .removeField("oldField") .run(); const updated = results.updated; // 2 const errors = results.errors; // [] }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?