【问题标题】:How to get specific value or row data from firebase in web [duplicate]如何从网络中的firebase获取特定值或行数据[重复]
【发布时间】:2018-12-04 06:53:42
【问题描述】:

基本上我是 firebase 新手,我只想知道如何从 firebase 检索特定数据, [firabase](https://i.stack.imgur.com/vk0S6.png[1]

如上图所示,我想像在我们使用的 Sql 中一样检索 Select CellNum from Student where Email="Adnan@gmail.com。 我怎样才能在 firebase web javascript 中做到这一点?

【问题讨论】:

标签: javascript firebase firebase-realtime-database


【解决方案1】:

尝试以下方法:

firebase.database().ref().child("Students").orderByChild("Email").equalTo("Adnan@gmail.com").once("value", function (snapshot) {
  snapshot.forEach(function(childSnapshot) {
    var cellNum=childSnapshot.val().CellNum;
  });
});

快照位于Students,然后您在id 22222 内循环并检索CellNumorderByChild 是查询 where Email="Adnan@gmail.com"

【讨论】:

  • 是的,这行得通,谢谢
猜你喜欢
  • 1970-01-01
  • 2017-09-03
  • 1970-01-01
  • 1970-01-01
  • 2020-01-29
  • 2021-10-25
  • 1970-01-01
  • 2018-04-02
相关资源
最近更新 更多