I have developed an app in Android studio and now I want to deploy a scheduled firebase function. My app contains various users and each user have a node named "clicksRemain", I want that after every 24 hours the value of this node may be reset to 0. Please have a look at the attached snapshot of my real-time database.
I I have written the following function and it's not working. Please help. Note: I am using firebase real time database.
const functions = require("firebase-functions");
const admin = require('firebase-admin');
admin.initializeApp();
const database = admin.database();
exports.scheduledFunction = functions.pubsub.schedule('* * * * *').onRun((context) => {
database.ref("Users/clicksRemain").update({"Users": admin.database.Timestamp.now()});
return console.log('Successfull timer update');;
});