Reputation: 107
I am creating a School exam application where I give some questions to the database(firestore) and I want to expire those data from the database after some specific time!! how to do this in firebase
Upvotes: 0
Views: 798
Reputation: 1236
Client-side centric:
OR:
Server-side...
If you actually want to delete the data from the db or mark it as "expired", you can create a Firebase function.
Let's assume that when creating an exam/question, you're adding an "expiration_time" when that data is supposed to be marked as "expired" or be deleted altogether.
Have your Firebase function do the following:
After you test your function and you know it works, make it so that it's a "Scheduled Firebase function" (google it if you don't know, it's easy to set up) - for example, make it run every minute.
Upvotes: 2