0👍
To update a Firestore document you’d need to call the set()
method with the { merge: true }
options object passed in as the SetOptions
argument.
addAssessment: function(payload) {
db.collection("users")
.doc(this.user.uid)
.collection("assessments")
.set({
name: payload,
criteria: payload,
createAt: firebase.firestore.FieldValue.serverTimestamp()
}, { merge: true });
},
That will also create the document if it does not yet exist.
- [Vuejs]-MEVN app deployment to Heroku failed because of 'vue-cli-service' not found
- [Vuejs]-How do I trigger a click event using eventBus on vue?
Source:stackexchange.com