简体   繁体   English

使用变量从 firebase 中的实时数据库获取数据

[英]Get data from realtime db in firebase using a variable

I want to take data from realtime db using a variable using react js.我想使用 react js 使用变量从实时数据库中获取数据。 enter image description here在此处输入图像描述

I tried all possible ways我尝试了所有可能的方法

You can access the data using onSnapshot, and also you can ensure that the data is updated when changes occur.您可以使用 onSnapshot 访问数据,还可以确保在发生更改时更新数据。 There are examples here https://firebase.google.com/docs/firestore/query-data/listen这里有例子https://firebase.google.com/docs/firestore/query-data/listen

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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