How to increment existing number field in Cloud Firestore

前端 未结 2 1763
长情又很酷
长情又很酷 2020-12-30 23:17

I have a field which indicates the number of transactions. I would like to increment it by 1 as soon as a transaction occurs. I could\'nt find any method to dir

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-30 23:33

    You should write a cloud function that listens to the transaction, then increase the index.

    https://firebase.google.com/docs/functions/

提交回复
热议问题