0

I am new in firebase. I am using firebase in my angular 2 project. I pushed some data to firebase DB. But i don't know how to get the size of data in db. if we push data to firebase, the data in firebase is something like this. I need to get the length of the firbase Object

   -JgaQt-tNq-gRVIVZdCD
     artist: 'name'
     track:  '001'
   -JgaQuBoYk9VX3pWylx3
     artist: 'name'
     track: '002'
   -JgaQuf_pyBFJ7EA1Fo_
     artist: 'name'
     track: '003'

Please suggest!!

Sarath
  • 1,459
  • 3
  • 22
  • 38
  • what do you mean _size of data_? show some code – Max Koretskyi Aug 16 '17 at 07:37
  • updated the question . Please check – Sarath Aug 16 '17 at 07:44
  • Already asked and answered. You cannot get just the length (assuming you mean the number of entries). You need to get the entire node, then `Object.keys(node).length` gives you the length. See https://stackoverflow.com/questions/38443421/how-to-get-size-of-an-element-list-in-firebase-without-get-it-all. –  Aug 16 '17 at 07:48
  • 2
    Possible duplicate of [How to get size of an element/list in Firebase without get it all?](https://stackoverflow.com/questions/38443421/how-to-get-size-of-an-element-list-in-firebase-without-get-it-all) –  Aug 16 '17 at 07:49

0 Answers0