[Vuejs]-How do I delete a specific map from firestore?

0👍

I found the solution.

The working code looks like this:

ref.get().then(doc => {
          if (doc.exists) {
            ref.update( { [mapName]: firebase.firestore.FieldValue.delete() } )
          }
        })

It seems that, to delete a single map, I needed to put the "firebase.firestore." before the FieldValue even I imported firebase (import firebase from ‘firebase’).

Leave a comment