【问题标题】:How to search firebase DB for particular value? [duplicate]如何在 Firebase DB 中搜索特定值? [复制]
【发布时间】:2017-05-24 05:07:36
【问题描述】:

我有一个按以下方式设置的 firebase 数据结构

volunteers
 -Ka3oeRZ-RhhJ-Iw5CmE
    address: '17 McGovern Lane',
    email: 'sure@gmail.com'
 -Ka3oeRZ-RhhJ-Dkxc43
    address: '9 Palace Drive',
    email: 'wonton@gmail.com'
 -Ka3oeRZ-RhhJ-Acda2
    address: '10 Happy Lane',
    email: 'happy@gmail.com'

有没有办法查询所有这些以检查特定的电子邮件?我正在尝试找出不同的选项,但对订购的内容有点困惑。

【问题讨论】:

标签: firebase firebase-realtime-database


【解决方案1】:

您可以使用 Firebase 查询:

var query = firebase.database().ref().child('volunteers').orderByChild('email').equalTo(email); // the var email is the email you're looking for

【讨论】:

    猜你喜欢
    • 2023-04-07
    • 2018-05-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-04
    • 1970-01-01
    • 2012-08-14
    • 1970-01-01
    相关资源
    最近更新 更多