firebase - Does DataSnapshot object contains all of its child data? -
how performance of spanshot.numchildren() when have large number of children?
does firebase go through of children count number of children or maintains counter when new child added ?
a datasnapshot contains of data locally in memory. calling numchildren or else on datasnapshot not result in network i/o.
note means should careful when generating snapshots -- if want count number of something, loading large datasnapshot , calling numchildren() more expensive than, example, maintaining separate count of children , updating transaction every time new child added.
Comments
Post a Comment