Propo41/aust_travels

Add a view counter in live track activity to show the number of people viewing it

Propo41 opened this issue · 1 comments

Add a view counter in live track activity to show the number of people viewing it

https://stackoverflow.com/questions/37403251/how-can-i-track-the-current-number-of-viewers-of-an-item

Instead of using a count variable, we can instead use a data model (as is often the case with NoSQL databases) to store the values of the users' UIDs and then get the total number of children count. This way, race conditions can be avoided and the transactions can be handled properly.

image