Realtime Firebase Increment counter.

1,050 views
Skip to first unread message

Deepty Srivastava

unread,
Jun 18, 2019, 9:22:16 AM6/18/19
to Firebase Google Group
Hi,

Incrementing values automatically with Cloud firestore.(https://firebase.googleblog.com/2019/03/increment-server-side-cloud-firestore.html)

document("fitness_teams/Team_1").
  updateData(["step_counter" : FieldValue.increment(500)])

How can I use this in Realtime Firebase? 

Please help. 

Thanks 



Sam Stern

unread,
Jun 18, 2019, 1:19:28 PM6/18/19
to Firebase Google Group
HI Deepty,

There is no such feature available for Realtime Database. Instead you should create a transaction where you read and increment the value.

- Sam

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/ab6ee3b0-08ab-4980-9e71-185e9268933f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages