How can I delete all the true value in the 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));
};
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.