0

we have large dataset in firebase, we want to get child count from given timestamp, currently only way we are able to achieve is load all the data to the client.

Is there any firebase API to just get count from given point instead of loading complete data to the client?

Jaagaa
  • 63
  • 1
  • 5
  • There is no built-in count query. You will either have to retrieve the data or keep a separate node where you track the count. See http://stackoverflow.com/questions/15148803/in-firebase-is-there-a-way-to-get-the-number-of-children-of-a-node-without-load, http://stackoverflow.com/questions/38443421/how-to-get-size-of-an-element-list-in-firebase-without-get-it-all or some of the other results in http://stackoverflow.com/search?q=%5Bfirebase%5D+count+child+nodes – Frank van Puffelen Dec 02 '16 at 18:31
  • I am not sure if the referenced posts suggest this but keeping a parallel node with less data is also an option. i.e. our /users node has 10k users with all of their data. We have another node called /shoe_size that only stores a small set of data - their shoe size. Even though that node is the same length, the child data is tiny so it's very fast to count. – Jay Dec 02 '16 at 18:36

0 Answers0