[Vuejs]-Sending multiple values to firebase with vue.js

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.

Leave a comment