I have a nested maps on Firestore, I am trying to update an object into another object using dot notation but it's concatenate the called key with object name in Firestore, if I update this nested map (object) without dot notation, will overwrite the entire map field.
if (doc && doc.exists) {
await doc.ref.update({subscription: {chartslab: {
"options.expiration": new Date(new Date()
.getTime()+(10*24*60*60*1000)),
"options.updatedAt": new Date().toISOString(),
}}}).then(() => {
return res.status(200).send("Document successfully updated!");
});
} else {
await doc.ref.set({subscription: {chartslab: {options: {
expiration: new Date(new Date().getTime()+(5*24*60*60*1000)),
}}}});
return res.status(200).send("Done");
}
Create
Update

