Delete data in realtime firebase database: messages of a certain user and the user itself

Viewed 88

We want to delete all the messages of a certain user and the user at a certain event. We know how to delete a user but have no clue how to delete his messages. The following picture is showing our database: Database

The messages should be deleted below the removal of the user Code

1 Answers

You can trigger a firebase function when deleting a user.

In firebase you could get a user ID and search trought your database.

This is typically a backend funcion.

Firebase provide an extention for this purpose

Related