Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
370 views
in Technique[技术] by (71.8m points)

How do I reset a value in a database every day in firebase database?

Let's say I have a value at

"/nullable/uid/"

and it has this line:

daily_rep: 10

and so, how to make this daily_rep become 0 every day, let's say at 22: 00

what do you need to do for this? for example, use Firebase Functions?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There is no built-in functionality for such operations in the Firebase Realtime Database, so you'll need to use an external mechanism to perform such an operation.

Cloud Functions for Firebase are definitely a great option for this, as they have a built-in capability to run functions on a schedule. But honestly, any other place where you can run code on a schedule could probably work too, as long as you can access the database through one of the Firebase SDKs or through the REST API.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...