Firebase gets the length of the object / number of children in the object

Is there a way to get the number of children of an object without loading the entire object? From what I understand, using numChildren will load the whole object first, right?

+4
source share
1 answer

Yes, at the moment it would be. Obtaining the number of children not loading the entire facility is currently not possible (although this may be a feature added in the future).

As a job, you can try to keep the length in a separate place in Firebase (and update its value when adding or removing children).

+3
source

Source: https://habr.com/ru/post/1488824/


All Articles