Let's say I create an FQuery limited to 30 items. If subsequently create an FQuery limited to 60 items, is Firebase going to those first 30 items from the server, or just copy them from the previous query?

I'm trying to implement paging in a mobile app so I'm looking for the most data-efficient way.

有帮助吗?

解决方案

In general, if you create a new query and observe events on it, we'll retrieve everything in the query from the server. So in your example, we'll re-retrieve the first 30 items when you do the limit 60 query.

The one exception is if you have an observer with no query at all at a location, then any queries you do at that location or underneath it will not retrieve anything from the server, since we know for sure that we have all of the data.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top