-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can we increase or decrease an integer value by 1. #270
Comments
That isn't possible with this library |
Hi, I got good news for you, it is possible with this library! Based on their documentation: https://firebase.google.com/docs/reference/rest/database#section-server-values
If you want to "Decrease" the integer by 1, just use Let me know if this works for you |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing the issue due to inactivity. Feel free to re-open |
Suppose I have a firebase node named "Likes" that contains integer values.
How can I increase or decrease the value of this key by one without fetching the value of the key.
Fetching the key may create problem like :
=> user1 fetches value = 10
=> user2 fetches value = 10
=> user1 increases value by 1 = 11
=> user2 increases value by 1 = 11
Now database will have 11 as final value but if 2 users have incremented value after 10 then it should be 12.
I hope the problem is clear.
I am using Realtime firebase database.
The text was updated successfully, but these errors were encountered: