Firebase increase value without reading previous value?

前端 未结 1 1344
无人共我
无人共我 2021-01-23 10:47

I\'m developing an ios application using Firebase it has huge users. I need to update particular field value in Firebase database based on user\'s response. Is there a way to in

1条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-23 11:29

    From a client app, you cannot increment a value without reading it. If there are multiple writers, the last writer's value overwrites everything else.

    If you want to safely increment a value when there are concurrent writers of the same value, use a transaction.

    0 讨论(0)
提交回复
热议问题