Paging with firebase

In case I have 1000 products and add a search system for these products, the firebase has to bring me all the 1000 data to later compare in the app which product is the one that is similar to what the user is looking for.

But this way the app will look very heavy when bringing 1000 products, each one with its respective values.

How can you apply?

One of the answers is with pagination, making it load out of the 1000 products only 50 products per page.

How can I do this?

You can get all tagIMG_20210511_231923

yes, I can get all the “1000 products with their varieties of values”, but it is not the idea …

I would like to call the first 50 labels and then when pressing a button, the other 50 and so on.

Now I don’t know if it would be easier to call and at 50 stop the process of calling labels (which I don’t know if it can be done) or organize the data when saving the information, that is, a list of labels that has another 50 labels and so on.

What do you think of what I said?

Use the same… when screen initialise call all the tag list and store it in a variable.

So when user clicked button use the block
for each number here you use length first 50. If no match Found mean design rule and create another for each number and so but you must create valid logic

Ok, you gave me the solution to the pagination, but it does not solve the lag that the app will generate when it brings those 1000 products or who knows how many more. (and followed to bring them, I will have to bring your sub data that would be: the name of the product, description, price, image, rating, among others)