Operation set on realtime database server without client

I have a “number” tag in realtime… when a user clicks a button in my app I call the “number” tag so I add +1 to that value and then send the new value back to firebase. … the problem is that if two users click on that button at the same time, the firebase tag, instead of becoming the value “2”, only becomes “1” since the value received by the two users at the same time is “0” (checked) … so I want to know if there are ways to send a data and that firebase itself does the sum without the need for the client to do it

What you have tried in blocks, just shows us.

If you use get value +1 then no problem, else it will behave like that only.

Try to use save Firebase value in when Firebase got value event itself

1 Like

sorry, I always read before asking but this time I thought it was not possible … I used the append block and then “list length” when I received the value, so I got the number of users who clicked even at the same time, thanks !