Skip to content
Advertisement

Change the field value in Firestore automatically after a certain time [closed]

I’m working on Javascript and here’s how’s my data looks like. Here the ss of my firestore

I want the functionality where after every 24 hours, my stateChanges fields updates to 0. (see the circled field). Any help would be appreciated.

Advertisement

Answer

There is no such functionality built-in in Firestore.

A possilbe solution would be to use an HTTP Cloud Function which will alternate state and invoke it with a Cloud Scheduler cron job every 24 hours.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement