This repository was archived by the owner on Mar 2, 2021. It is now read-only.

Description
In emberfire v2 (the version we're using) you can count the amount of tracks in a channel by checking the length of the ids in channels.tracks without fetching all tracks.
This is not possible in v3, see FirebaseExtended/emberfire#587.
If you're not using Emberfire, which is more and more likely, you can fetch a channel and count the tracks.length yourself. But having a number property like tracksCount would be very useful.
To do this we'll need to implement a Firebase cloud function. Copy/pasta from here https://github.com/firebase/functions-samples/tree/master/child-count
@hugurp should we do this? I'm not a huge fan of maintaining an extra cloud function, however small it is. On the other side, I want to be able to count tracks easily without fetching all tracks across our applications.