You are on page 1of 1

Mohamad Hashem

201701363

How do I paginate My Data?

To begin with, data is huge and wide but users use small amounts of it.

To build a new query, you write the same code but add “start”

You need to start from where you stopped in the first query.

“order must be taken into consideration otherwise the query will run differently”

Pagination is the process of dividing data into discrete pages. In Firestore, it is achieved by ordering a
collection by a field, limiting it to a consistent page size, then offsetting the query

There are 2 methods to make this easier.

It’s hard for beginners to regenerate a query from the start relying on UI elements not found on the
screen you can take the already formed and existing query and add on it the new conditions, you can
take it and change the variables and this would make is much easier than building new queries

Second, if you switch the code an error will occur in that case you can add an already existing document
from the cloud fire and the system will analyze it and know what they are looking for but in case 2
documents where similar it can identify the ID, in this technique the system will run perfectly and save
the data. But one must be aware so the data won’t be messed up but that depends on the type and
version of the app, “the newest the least errors”

Adding new lists for every new patch, which will divide the data and help more in keeping them safe and
updated

Third way is boy paginate at all, which means you keep the query the same, but you keep on adding the
“limit”

But this will make you pay charges for all the reads in the data which neglects the idea of adding a
paginate in the beginning, but it’s still a good idea to save data

“Offset you still pay”

And he is given an examples during his tutorial about searching for best restaurant.

You might also like