javascript - 无效查询。您不能使用多个 'in' 过滤器

标签 javascript firebase google-cloud-platform google-cloud-firestore

this.ref.collection("users", ref => ref.where("uid1","in", [reciverId, senderId])
        .where("uid2","in", [reciverId, senderId]))

给我错误,例如

"Invalid query. You cannot use more than one 'in' filter"

最佳答案

更新:

自 2023 年 3 月 16 日发布 Firebase JS SDK 版本 9.18.0 以来,可以在查询中组合多个 in 子句。

但请注意,“Cloud Firestore 将查询限制为析取范式中的最多 30 个析取”,如 documentation 中所述。 (其中包括不同类型查询的析取数量示例)

<小时/>

旧答案:

这确实是 Firestore 的限制,如 documentation 中所述。 :

Limitations

Note the following limitations for in and array-contains-any:

  • in and array-contains-any support up to 10 comparison values.
  • You can use only one in or array-contains-any clause per query. You can't use both in and array-contains-any in the same query.
  • You can combine array-contains with in but not with array-contains-any.

关于javascript - 无效查询。您不能使用多个 'in' 过滤器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60474746/

相关文章:

Swift 从初始化程序返回而不初始化所有存储的属性

node.js - 有没有一种方法可以在不使用 sendGrid 或 mailJet 等中介服务的情况下使用 nodejs 发送 appengine 邮件

firebase - 使用 Firebase Export Collections to BigQuery 扩展将 Firestore 数据以表格格式存储在 BigQuery 中

javascript - 为什么 window.onload 事件发生在 $(document).ready 之前?

javascript - div 中的最后一个 span 改变了它的宽度

android - 如何检测在 Firebase 测试实验室中运行

android - 如何获取 firestore 集合中的文档数

kubernetes - 在 GKE 集群中安装 Velero 时无法拉取镜像 "velero/velero-plugin-for-gcp:v1.1.0"

javascript - html垂直自动滚动与javascript

javascript - 如何获取两个位置之间路线的中心纬度和经度