This is the example provided in the documentation to update a field within a nested object in firebase.
var frankDocRef = db.collection(\"users\").doc(\"frank\"
To add an entry to a set (a Javascript Object), use DocumentReference.update:
DocumentReference.update
db.collection("users").doc("frank").update({ "favorites.firebase": "Help")} })
will result in
favorites: { food: "Pizza", color: "Blue", subject: "recess", firebase: "Help" }