Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

280
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda