FirestorePagingAdapter 是否一次获取页面中的文档或所有文档然后应用分页?

Does FirestorePagingAdapter fetch document in pages or all document at once and then apply paging?

我正在使用 Firestore 来存储我的数据。现在我想从中获取特定的集合。我正在使用 FirestorePagingAdapter 来执行此操作。

场景:我正在查询 Firestore 以从特定集合中获取所有文档,假设 posts(collection) 包含 100 个文档,FirestorePagingAdapter 配置如下

-setPrefetchDistance(2)
-setInitialLoadSizeHint(10)
-setPageSize(10)

现在我的疑问是 FirestorePagingAdapter 一次获取所有文档(意味着一次获取所有 100 个文档)然后根据页面大小(一次 10 个)应用分页或查询 Firestore,以及何时到达底部, 会获取下 10 个文档吗?

基本上我想减少 Firestore 中的读取操作。

请帮帮我。

will FirestorePagingAdapter fetch all documents at once (means all 100 doc once) then then apply paging

绝对不是。

query Firestore according to page size (10 at a time), and when reaches to bottom, will fetch next 10 doc?

当然可以。因此,第一次向您收取 10 次读取操作的费用,一旦您加载了 10 个以上的项目,您将额外支付 10 次读取操作的费用。因此,如果您只加载项目的两个部分(20 个项目),您将需要支付 20 次读取操作费用,而 而不是 需要 100 次读取操作。