【问题标题】:Firestore and Vue.js multiple Where clauses [duplicate]Firestore 和 Vue.js 多个 Where 子句 [重复]
【发布时间】:2019-02-25 02:54:25
【问题描述】:

我需要使用多个 where 子句运行查询,但我的查询忽略了它们。我在网上查看过,找不到适合我需要的示例。 这是我目前正在使用的代码。任何和所有的帮助都将受到赞赏。

let codeRef = db.collection('codes')
    codeRef.where('code', '==', this.code)
    codeRef.where('gid', '==', this.gid)
    codeRef.get().then(snapshot => { ...

【问题讨论】:

  • 请仅使用相关技术标记您的问题。问题与 Firebase 实时数据库无关,虽然您无疑使用 vue.js,但它似乎与问题无关。

标签: javascript firebase google-cloud-firestore


【解决方案1】:

您是否尝试将它们结合起来?

let codeRef = db.collection('codes')
              .where('code','==',this.code)
              .where('gid','==',this.gid)
              .get()

【讨论】:

    猜你喜欢
    • 2018-06-10
    • 2021-02-04
    • 1970-01-01
    • 2021-02-03
    • 2017-08-30
    • 1970-01-01
    • 2016-10-23
    相关资源
    最近更新 更多