0

I want a child to be deleted after a certain amount of time. The data of the child is stored in multiple Firebase collections and I know nothing about .js (JavaScript!?). The idea is to remove the child after 2 hours automatically, without the user having to do anything additionally.. is this possible? If so, how?

JuFa512
  • 119
  • 7
  • You say "child", which is a term from Realtime Database, but also "collections" which is a Firestore term. Which of the two are you using? – Frank van Puffelen Oct 28 '21 at 22:55
  • For Realtime Database it'd be https://stackoverflow.com/questions/32004582/delete-firebase-data-older-than-2-hours. For Firestore it'd be the same setup, but then against the Firestore API. – Frank van Puffelen Oct 28 '21 at 23:24
  • How are you going to make sure that the device is connected when the app is supposed to delete a record? – El Tomato Oct 28 '21 at 23:57
  • @FrankvanPuffelen I am talking about the Realtime Database. Sorry for the confusion due to the wording "collection"... – JuFa512 Oct 29 '21 at 11:48
  • @ElTomato App is only working when connected to the internet.. – JuFa512 Oct 29 '21 at 11:49
  • In that case I'd recommend porting the code from my answer here to Swift: https://stackoverflow.com/questions/32004582/delete-firebase-data-older-than-2-hours. If you're struggling with a specific piece of that conversion, share what you tried and we'll try to help. – Frank van Puffelen Oct 29 '21 at 14:29

0 Answers0