I just wanted to delete data from Firebase realtime database where data is older than 1 hour. Is there any query for the Firebase query or not for this case ?
Asked
Active
Viewed 289 times
1 Answers
0
Realtime Database doesn't have a "delete where" type of query. You will have to break this down into three main steps:
- Query for all the data to delete, using a timestamp as a filter
- Iterate the results
- Delete each child

Doug Stevenson
- 297,357
- 32
- 422
- 441
-
can you please explain more ? – Pooya Salehi Jun 22 '20 at 22:32
-
These tasks should all be straightforward to perform if you've reviewed the documentation for Realtime Database. It doesn't get much easier. https://firebase.google.com/docs/database/android/read-and-write – Doug Stevenson Jun 22 '20 at 22:42