python - 如何按顺序检索 firebase 数据

标签 python firebase firebase-realtime-database iot

<分区>

This is how the data stored in Firebase

enter image description here

This is the output

enter image description here

这是代码

from firebase import firebase
url = "https://xxxx.firebaseio.com/"
fb = firebase.FirebaseApplication(url,None)
Humidity = fb.get("/Humidity",None)
for key, value in Humidity.items():
    print("Humidity :{}".format(value["hum"]))

最佳答案

试试这个...

snapshot = ref.order_by_child('/Humidity').get()

更多信息请查看此链接

https://firebase.google.com/docs/database/admin/retrieve-data

关于python - 如何按顺序检索 firebase 数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51822832/

相关文章:

python - ValueError : Shapes (16, ) 和 (1, 16) 在 tensorflow1.0 中不兼容

python - 将字符串转换为数字

android - onChildAdded 在每次应用程序启动时触发,但数据库中没有新条目

python - Firebase python,访问用户数据

Firebase - 按自定义功能排序(距离)

swift - 从 Firebase 同步读取

python - Map Reduce 常见查询的简单分数聚合

python - 如何自定义Folium中的LayerControl?

android - startAfter 在 Firestore android 中不起作用

ios - 调用 `FIRApp.configure()` 时首次运行应用程序崩溃