The Firebase JS SDK is now in BETA!
This EAP site is no longer maintained. See the official Firebase Documentation site for the latest documentation and information about the Firebase JS SDK.

Home > @firebase/firestore > / > arrayRemove

arrayRemove() function

Returns a special value that can be used with setDoc() or that tells the server to remove the given elements from any array value that already exists on the server. All instances of each element specified will be removed from the array. If the field being modified is not already an array it will be overwritten with an empty array.

Signature:

export declare function arrayRemove(...elements: unknown[]): FieldValue;

Parameters

Parameter Type Description
elements unknown[] The elements to remove from the array.

Returns:

FieldValue

The FieldValue sentinel for use in a call to setDoc() or updateDoc()