0

banco firestore

I need to update a status field in the index array [0] where time == 8:00, I need to pass this status to == "0", only that this array is inside a matrix that here in the image can be seen as a timer. How could I update this vector at index [0] by changing the status = 1 field to = 0?

To update a status outside an array and passing the values by hand I am using an example like this for testing only:

Firestore.instance.collection("area").document("alergia").collection("items")
     .document("RGiqOihmSxUlpVVEqPUo").collection("agenda").document("bgMHxqQEpt8Tha0pdOcY")
        .updateData({"statusdata": 0});

1 Answer 1

1

Firestore doesn't offer any updates that allow you to directly change array items by their index. You will have to write code to read the document, modify the array in memory to be the way you want, then update the array field back to the document.

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

1 Comment

Thanks Doug, for help me, but do you has any ease example for can I see, the syntax's or small part of code, please.. And Thks again.

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.