removeFromArray( )


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 remove the first instance of the specified value from the specified array field.

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

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


valueanyRequired

Value whose first instance is removed from the specified array field.

Returns
Return Type:WixDataBulkPatch
Remove from array
JavaScript
import { items } from "@wix/data"; async function removeFromArray() { const results = await items .bulkPatch("BlogPosts", [ "fb071093-9a40-432d-ae1f-2e5966fecbfa", "9fe1a67f-fc60-4e99-8898-3f9e719ca62f", ]) .removeFromArray("tags", "travel") .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?