Suppouse a firestore Database filled with this structure, being Events and Users collections:
Firestore
-Events
-1612483200
-peopleSignedDict
-Alex
-state: 1
-Mark:
-state: 0
-1606172400
-peopleSignedDict
-Users
-1zyXSMMlGiaUusUNLQWAxfsI4pM2
-name: Alex
-4zyXSMMlGiaUusUNLQWAxfsI4pM2
-name: Mark
I'm using Node.js and trying to update Events.1612483200.peopleSignedDict.Alex.state to change the state from 1 to 0. To achieve it I'm trying to do:
var randomName = getRandomDBName();
db.collection('Events').doc('1612483200').set({
'peopleSignedDict.'+randomName+'.state': 0
});
But ofc my IDE (PhpStorm) yells at me telling that this syntax is not valid, which should be the correct syntax to approach this?