r/JavaScriptTips • • Sep 27 '22

how to delete a document in the mongodb collection by clicking on that delete icon ?

Hi all , i'am working on a simple CRUD project( express ) , inserting data in collection with a form (working), reading it in a HTML table(working), but in the HTML table i have a column called action contains two icon buttons for deleting and updating data, i want to know how to delete the document in the mongodb collection by clicking on that delete icon, how can i detect the ID of the document in that specific HTML TABLE row that contains that delete icon knowing that iam reading a bunch of documents and that i'am nor displaying the id in the table and iam storing my documents in array ? ty

0 Upvotes

0 comments sorted by