firebase/snippets-web

It should be deleteDoc, not updateDoc

cbondoc opened this issue · 1 comments

import { doc, updateDoc, deleteField } from "firebase/firestore";
const cityRef = doc(db, 'cities', 'BJ');
// Remove the 'capital' field from the document
await updateDoc(cityRef, {
capital: deleteField()
});

The thing is you are updating a item in a collection but not deleting the item may be that's the reason they called it updateDoc instead of deleteDoc