How to loop through each firebase database child with python? -
i have firebase data structure
i want print keys under firebase generated keys (i.e 3030-00-809-7702 newnsn) use code
inventory = db.child("inventories").get() business in inventory.each(): businessid = business.key() productdb = db.child("inventories").child(businessid).get() product in productdb.each(): productid = product.key() print(businessid) print(productid)
but
so last keys being printed instead of keys. doing wrongly , how can print keys ?
just print value @ current tree whole thing
inventory = db.child("inventories").get() business in inventory.each(): print(business.val())
or go iterate it, inefficient request n items firebase n children.
inventorydb = db.child("inventories") businessid in inventorydb.shallow().get().each(): productdb = inventory.child(businessid) # print ids print([id id in productdb.shallow().get()])
Comments
Post a Comment