Cloud Firestore: Update fields in nested objects with dynamic key
I found the solution inspired by a firebase solution (replacing "/" by ".").
var usersUpdate = {};
usersUpdate[`favorites.${key}.color`] = true;
db.collection("users").doc("frank").update(usersUpdate);
This solution worked for me:
db.collection('users').doc('frank').update({
[`favorites.${key}.color`]: true
});