Pregunta

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.

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top