title: How to loop through each firebase database child with python?
body: <p>I have this firebase data structure </p>
  
  <p><a href="https://i.stack.imgur.com/5Uh9k.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5Uh9k.png" alt="enter image description here"></a></p>
  
  <p>I want to print all the keys under the firebase generated keys (i.e from 3030-00-809-7702 to newNSN) so I use this code </p>
  
  <pre><code>Inventory = db.child("Inventories").get()
  for business in Inventory.each():
  businessid = business.key()
  productdb = db.child("Inventories").child(businessid).get()
  
  
  for product in productdb.each():
      productid = product.key()
  print(businessid)
  print(productid)
  </code></pre>
  
  <p>but I what I get is this </p>
  
  <p><a href="https://i.stack.imgur.com/Gq40h.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Gq40h.png" alt="enter image description here"></a></p>
  
  <p>so only the last keys are being printed instead of all the keys. What am I doing wrongly and how can I get it to print all the keys ?</p>