How to increment a record in Firebase?

后端 未结 5 751
余生分开走
余生分开走 2020-12-05 19:42

I have a Firebase record \"searches: 0\" for each user. On some event, I\'d like to add 1 to what the current count is. I\'ve gotten this far, but for some reason, it\'s not

5条回答
  •  旧时难觅i
    2020-12-05 20:22

    ref.transection(function(queue_length) {
        if(queue_length|| (queue_length === 0))
        {
            queue_length++; 
        }
        return queue_length;
    
    })
    

    You can use like this ;)

提交回复
热议问题