How can I use a Cloud function to change realtime data in my firebase database every-time the function is called? I have a data cell called Points and I want to change the value of Points into a random number between 1 and 10 every time the function is deployed. I am really new to using firebase so I wouldn't know where to really start. I have looked most of the documentation provided but none of them helped. I have tried a few things but failed miserably. Please help
Thank you,
This is what I tried...
exports.userVerification = functions.database.ref('Points')
var ref = database().ref('Points')
var number = (Math.floor(Math.random() * 10) + 1)*10
ref.update(number)