1

i am trying to delete an index inside array

this is the data structure enter image description here

I want the user to delete the selected car so it could be index 0 or whatever

1 Answer 1

2

My opinion is fetch the document and delete the item at which index you want from the local array and update the remote document. Or you can use .document('docID').updateData('cars': FieldValue.arrayRemove([{the-item-map}]));. Maybe there are other options but these two options are acceptable, I prefer to use first one.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks i never thought to do it . The first method sounds good

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.