简体   繁体   中英

How to retrieve data from Firebase using Python?

I'm new to Firebase and I'm trying to retrieve some test data that I created. I'm able to connect to the database, as I get a return value of 0. When I try to pull data, I get None as the result. I'm expecting the data in the database to be retrieve.

import firebase_admin
from firebase_admin import credentials
from firebase_admin import db

cred = credentials.Certificate("Path to Json fire")


firebase_admin.initialize_app(cred, {'databaseURL': 'Database URL'})

ref = db.reference('Secret')

results = ref.child("test").get()

print(results)

I'm expecting the results to return the data in my database. However, I'm getting the result None.

check the name of the folder in which you have the information again. If it is mentioned wrong, then data would be returned none.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM