Reputation: 20396
I have this database. I want to update channels 2 to false.
db.collection('preferences').doc(user_id).update({communication:{'1':{channels:{'2':false}}}})
But as a result, channel 4 disappears:
Upvotes: 0
Views: 25
Reputation: 871
You can update the following structure with dot notation.
firebase
.firestore()
.collection("preferences")
.doc("user_id")
.update({
"communication.1.channels.2": false
});
Upvotes: 2