Skip to content

It should be deleteDoc, not updateDoc #368

Open
@cbondoc

Description

@cbondoc

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()
});

Activity

Nitinkumar-29

Nitinkumar-29 commented on Jun 11, 2024

@Nitinkumar-29

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      It should be deleteDoc, not updateDoc · Issue #368 · firebase/snippets-web