firebase / firebase/firebase-admin-python

[FR] Add the `increment` method for realtime database

Open
#675 1 comment 0 reactions 0 assignees View on GitHub
api: database type: feature request
Dominant language
Python
Stars
1.2k
Forks
359
Avg merge
5d 6m
Merged PRs (30d)
2

Description

**Is your feature request related to a problem? Please describe.**

Please see this SO [question](https://stackoverflow.com/questions/75486368/how-to-increment-values-in-firebase-realtime-database-python/75486555#75486555) that i have asked.

**Describe the solution you'd like**

I would like to be able to increment a value server side such as :

```
from firebase_admin import db

realtime_db = db.reference(path="/", app=app, url="myurl")
realtime_db.update({
f"chats/{uid}/num": db.increment(1),
})
```

**Describe alternatives you've considered**

The alternative described in the SO question as an answer.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the Python Admin SDK realtime database entry points shown in the example, especially db.reference() and update(). Compare the requested server-side increment behavior with the linked Stack Overflow question, then identify the existing database tests; done means update() accepts the increment value and verifies the expected Firebase Realtime Database behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
firebase, python
Domain
backend, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.