firebase / firebase/firebase-admin-go

To add support for server value increment

Open
#509 2 comments 0 reactions 1 assignee Claimed by @lahirumaramba View on GitHub
api: database type: feature request
Dominant language
Go
Stars
1.3k
Forks
274
Avg merge
10h 39m
Merged PRs (30d)
2

Description

Hi, I have a use case of updating a counter field in the realtime db, and i am looking for this `ServerValue.Increment()` API, seems not supported in golang sdk.

I want to update this field on the server side without having to read the original value and do not need to worry about multi-write conflicts.

### - The doc for ServerValue.Increment():
https://firebase.google.com/docs/database/web/read-and-write#atomic_server-side_increments\\

### - And a ref about the performance gain compare to transactional update:
https://www.faqcode4u.com/faq/59074/how-quickly-can-you-atomically-increment-a-value-on-the-firebase-realtime-database
![image](https://user-images.githubusercontent.com/18282328/187071446-81051280-6d58-4075-94c6-220612844b50.png)

### - It's there in the node.js sdk seems
https://github.com/firebase/firebase-admin-node/blob/a510ef4599a5a8b9a968543f6479e2b6319c2923/src/database/database-namespace.ts#L106

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.