Firestore:分页不重复计费

huangapple go评论67阅读模式
英文:

Firestore: pagination without charging twice

问题

我想要为我的集合添加一些分页功能(带有监听器),但为此,我需要首先获取接下来的 n 个项目,然后从第一个文档到最后一个文档创建新的监听器。
这个操作会导致我被双重计费 - 一次是获取,然后是不必要的第一个监听器结果。
我们能避免这种情况吗?

英文:

I want to add some pagination (with listeners) to my collection but for that I need to first get the next n items and them create new listener from the first doc to the last doc.
this operation will make me charged twice - for the get and then, for the unnecessary first listener result.
can we avoid this situation?

答案1

得分: 1

目前,Firestore 不支持使用监听器进行分页,但正如 @Doug Stevenson 所述,社区中已经有一些解决方法可供参考。

您可以查看以下线程以供参考:

英文:

Currently, Firestore doesn't support pagination with listeners however, as stated by @Doug Stevenson, there are some workarounds that you can do about it that are already here in the community.

You may look at these threads for reference:

huangapple
  • 本文由 发表于 2023年3月3日 22:11:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/75628156.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定