Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

543
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda