【问题标题】:How to query realtime database with AngularFire?如何使用 AngularFire 查询实时数据库?
【发布时间】:2021-01-31 18:08:25
【问题描述】:

如何在实时数据库中检查特定数据以及在 firestore 中检查?

this.afs.collection('collection', ref => ref.where('data', "==", date
    )).snapshotChanges(.subscribe(res => {

我试过了

this.database.list('collection', ref => ref.where

但是,“'Reference' 类型上不存在属性 'where'。”

【问题讨论】:

    标签: javascript firebase-realtime-database angularfire2


    【解决方案1】:

    我建议查看 querying lists in the realtime database 上的 AngularFire 文档和 ordering and filtering Realtime Database data in JavaScript 上的 Firebase 文档,它们表明查询是通过以下方式完成的:

    this.database.list('collection', ref => ref.orderByChild("data").equalTo(date))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-14
      • 1970-01-01
      • 2014-04-19
      • 1970-01-01
      相关资源
      最近更新 更多