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/