I want to delete the first element of Array.
Asked
Active
Viewed 1,622 times
-2
-
1Can you be more specific? – Yatinj Sutariya May 01 '21 at 13:21
2 Answers
0
You can by just updating the whole array :
yourArray.removeAt(0); //yourArray is the array in the firestore before changing anything
doc("docId").update("Array" : yourArray);

Khalil Ktiri
- 181
- 1
- 6
0
To remove an array inside Firebase Firestore. Try the following function:
docRef.update({
array: FieldValue.arrayRemove(''); // Here add your Element ID which you want to remove it.
});
Notice
: This method only works with simple array like ["test","test"]
not array with objects.
Thanks for @Evin1_ in (https://stackoverflow.com/a/59745086/14945696).

Kevin M. Mansour
- 2,915
- 6
- 18
- 35