How can I update a nested value that is undetermined until runtime?
For example, I wish to update the value at the key which is a user's id. I don't know which user to update until runtime.
The docs give this example code (https://firebase.google.com/docs/firestore/manage-data/add-data#update_fields_in_nested_objects):
db.collection("users").doc("frank").update({
"age": 13,
"favorites.color": "Red"
})
I have modified it using template literals to suit my purposes:
db.collection("chatGroups").doc(route.params.data.id).update({
`markedDates.${auth.currentUser.uid}`: markedDates
});
but it throws syntax errors.