0

I'm making a meeting app where user can create a group of people who are part of that meeting , also date and time of the meeting has to be set when group is created and store in the firebase database. When the date and time of meeting is passed Firebase should automatically delete child nodes of that group. I'm thinking of cloud function , but don't know how to make this work.

Renaud Tarnec
  • 79,263
  • 10
  • 95
  • 121
parag pawar
  • 193
  • 3
  • 13

1 Answers1

1

On top of my head, you can do three things:

1) Cloud Functions: You correctly pointed it out that a cloud function is the correct way. However, a cloud function will need a trigger as far as I understand. You can run this trigger on a daily basis for instance to clear all meetings after due date. Potential way to run this trigger can be a cron job from a website like https://www.easycron.com/

2) Event Listener on a client: If you have a listener fixed on a client then you can put a check each time its run. So any client running their own event will clear it based on a check. It will not clear automatically after time passes but will clear once a relevant client listens for it.

3) Ignore meetings after due dates on a client. That way you save the old data as well. Might be costly in terms of bandwidth in the long term.

Also, if you have just started, I'd personally advice to use Firebase Firestore instead. I found it much better to use.

dejavu89
  • 754
  • 1
  • 7
  • 17