Answers for "delete perticular document in firestore"

1

delete perticular document in firestore

function delete_firebase(id) {
        console.log('delete: ' + id);
        var user_select = confirm('Are you sure you want to delete this post?');
        if (user_select == true) {
            var db = firebase.firestore();
            db.collection("form").doc(id).delete().then(() => {
                alert('Post Deleted Successfully!');
                console.log("Document successfully deleted!");
            }).catch((error) => {
                console.error("Error removing document: ", error);
            });
        }
    }
Posted by: Guest on October-20-2021

Code answers related to "delete perticular document in firestore"

Browse Popular Code Answers by Language