1

I want to store some data in firebase which is available only for a limited time.

For eg if I am saving my data today then my data should only be available for that day and it should be deleted by tomorrow automatically. is there any way to store time limited data in firebase?.

Lokesh Lalwani
  • 145
  • 1
  • 8

1 Answers1

1

is there any way to store time limited data in firebase?

No but there is a workaround that can help you achieve the same thing. First you should add under each of your objects a Timestamp as explained in my answer from this post.

Then simply use Cloud Scheduler recently released by Google Cloud, which will allow you to schedule HTTP requests or Cloud Pub/Sub messages to functions written in Cloud Functions for Firebase that you deploy.

Alex Mamo
  • 130,605
  • 17
  • 163
  • 193
  • can you please give me an example of how I should use the cloud scheduler and how to deploy cloud functions. – Lokesh Lalwani Apr 23 '19 at 17:46
  • Cloud Scheduler is recently released so I recommend you to read the official documentation first. It is very well explained. So you should make your own attempt given the information in the answer and ask another question if something else comes up. – Alex Mamo Apr 23 '19 at 17:50
  • okay cool, thanks for all your help :)) I'll mark it as accepted if it the solution work. – Lokesh Lalwani Apr 23 '19 at 19:56