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

537
Vistas
How to remove all true value in Realtime database (firebase v9) using reactjs?

How can I delete all the true value in the realtime database?

firebase realtime database

this is my code but it can only delete a certain item. How can I Make this to remove all items that have a "true" value.

const removeTodo = (uid) => {
 remove(ref(db, `/${auth.currentUser.uid}/${uid}`))
 .then(alert("Todo deleted."))
 .catch((error) => console.error(error));
};
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You first need to get all the RTDB nodes which have the completed sub-node set to true by following the documentation on how to filter data in the RTDB.

Then, for each of these nodes, you need to delete it. Since there are probably several nodes to delete, you can use the technique shown in the doc for simultaneously writing to specific nodes. And since you want to delete the nodes, you have to specify null as the value to be written for each node.


I let you implement the corresponding code. If you still encounter problems with your code, modify your question to show it together with the debugging details and, then, we (i.e. the community) will be able to help you further.

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