【问题标题】:How to access firebase database value in json format如何以 json 格式访问 firebase 数据库值
【发布时间】:2018-09-12 16:20:58
【问题描述】:

我的 JSON 结构如下-:

[how can i access this json structure for firebase realtime db, basically i want to print 
    id(numeric num), then the email_id][1]


  https://i.stack.imgur.com/UslTG.png

我想读取数值和电子邮件,并且该数值每次都会改变,我想读取最新添加到文章/中的值。?

【问题讨论】:

  • 您的问题中似乎缺少一些细节。请问可以填写吗?请查看我们的指南,了解有关提出好问题的提示:stackoverflow.com/help/how-to-ask

标签: javascript json firebase firebase-realtime-database google-cloud-functions


【解决方案1】:

如何检索 id(number- 并且没有密钥可以读取该 num) 和电子邮件

firebase.database().ref('/article/' + num + '/email/').on('value',function(snapshot) {
 var email = snapshot.val().email
  // ...
});

更多信息在:https://firebase.google.com/docs/database/web/read-and-write

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-05-06
    • 2016-12-08
    • 2017-12-06
    • 2019-11-17
    • 2021-07-24
    • 1970-01-01
    • 2018-04-18
    • 1970-01-01
    相关资源
    最近更新 更多