Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

281
Views
how to delete firebase Firstore document

I tried several methods, but when I actually click the delete button, not just one document is deleted, but all the documents. What should I do? Here's the code:

const db = firebase.firestore();
  db.collection('data').get().then((snapshot)=>{
    snapshot.forEach((doc)=>{

      const da = doc.id;

      function delei(){
        db.collection('data').doc(da).delete().then(()=>{
          console.log('deleted');
        })
      }

      


      var 템플릿 = `<div class="attend">
        <div class="date">${doc.data().날짜}</div>
        <div class="icons">
            <span class="download 48dp material-icons-outlined" onclick="location.href='${doc.data().엑셀}'">file_download</span>
            <span class="trash 48dp material-icons-outlined" onclick="${delei()}" >delete</span>
        </div>
    </div>`
      $('.big').append(템플릿);
    })
});

thank you

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I hope you are doing great. I will share with you two links to a beautiful tutorial about your question from YouTube. For firebase v9: https://www.youtube.com/watch?v=s1frrNxq4js For earlier version (like yours): https://www.youtube.com/watch?v=UZqXcoqC95E&list=PL4cUxeGkcC9itfjle0ji1xOZ2cjRGY_WB&index=5 I'm sorry that I didn't write the code but I saw your question and I was so tired, and I wanted to help with anything useful.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!