【问题标题】:Firebase query array 'in' limit of 10Firebase 查询数组 'in' 限制为 10
【发布时间】:2020-04-30 23:49:27
【问题描述】:

有什么办法可以超过firebase query "in"的10个限制吗?
或者任何使用firebase功能的解决方法来接收结果?

问题是我们有一个返回所有文档的无穷列表。

{
   title: 'some title',
   filterID: '1',
},
{
   title: 'some title',
   filterID: '2',
},
{
   title: 'some title',
   filterID: '3',
},
{
   title: 'some title',
   filterID: '4',
},
...

现在我们要构建一个过滤器,用户可以使用“in”查询设置和查询。

const filter = ['1','2','3']
firestore.collection('feed').where('filterID', 'in', filter).valueChanges();

这可以像我们想要的那样工作,但 filterID 的数量超过 10 个。
我们应该重组数据还是存在一个使用 firebase 函数的解决方法?

【问题讨论】:

    标签: node.js angular firebase google-cloud-functions


    【解决方案1】:

    一个 IN 查询的 10 个文档的限制是硬限制。没有任何结构上的改变会让您更轻松。

    您应该做的只是单独get() 每个文档,或者在每个文档上建立一个侦听器。

    【讨论】:

      猜你喜欢
      • 2020-08-04
      • 1970-01-01
      • 1970-01-01
      • 2012-12-23
      • 1970-01-01
      • 1970-01-01
      • 2019-10-09
      • 2023-03-14
      相关资源
      最近更新 更多