0

i am stuck with a problem with firebase (with Vue). I want to add the user id to a specific map (yes, maybe or no) when the user presses a specific button. But Im having trouble add/update the data because its nested. Here is my data structure in Firestore

firestore data structure

I want to add the user id in a map, something like this:

dates: { [ 0: { yes: [userId1, userId2] } ] } 

Does anyone can help me pushing the user ids into the arrays?

0

1 Answer 1

1

Unfortunately, right now it is not possible to update a specific element of the array. You can add new items or remove them - look here. But I would consider a little change in the approach and create a collection called dates in which you can define documents, which will contain yes, no, maybe arrays, which can be easily updated - in the way mentioned before.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.