geofirex icon indicating copy to clipboard operation
geofirex copied to clipboard

Enhancement Request: Pagination support

Open Lagistos opened this issue 6 years ago • 7 comments

Hi, It would be great if there will be a pagination to the queries, i know that there are 9 queries on each request, one for geo block so it's harder to pagination but do you have an idea how to make this happened?

And by the way, this libary is amezing, thank you very much.

Lagistos avatar Aug 03 '18 09:08 Lagistos

I've thought about this and have started working on a query first(n, center) that would return the first n results from the center. It's really only possible to paginate clientside because you don't know the full data picture until all 9 queries resolve.

codediodeio avatar Aug 03 '18 18:08 codediodeio

thanks for your answer, i saw the first function commented while i tried to understand how it works and write a pagination system.

i've thought maybe that if a limit has been set to get first all the results from the first query of the corrent area and after got all of the documents from the first area, to divide the limit by 8, and to limit each query to this amount and save the last indexes in some array to the next query, but i found 2 problem in this method, the first is that the limit sould be a multipication of 8 and the second problem it's that it was super defficult for me to implements until i will understand all of the code.

the thing that i fear from is because of the billing, even when i'm scalling down the results with the ref query it can be a lot of documents reading. but there is no any other soulotion for geo search in the firestore land for now. And i'm realy sorry about my english, it's not my strong side :)

Lagistos avatar Aug 03 '18 19:08 Lagistos

Yeah, Pagination would be great. We kind of need it for the apps we are building. Was looking at the code. Cause I keep getting core.js:1449 ERROR Error: Invalid query. You must not call Query.startAt() or Query.startAfter() before calling Query.orderBy(). When trying to use firestore queries. But for right now I am using a combination of where clauses for categories and page size limits. Not true pagination, but it works fine.

boolai avatar Aug 06 '18 09:08 boolai

Hello, has it been possible to advance in this? Paging would be a very useful thing to build ideas for the real world. Any way of how to face this challenge? Thank you

georgeMorales avatar Feb 21 '19 17:02 georgeMorales

Pagination would be awesome, however it would already help a lot if we could limit the amount of results returned by firestore, to make sure you don't get a million reads every time you query a larger radius.

philipfeldmann avatar Mar 22 '19 09:03 philipfeldmann

@codediodeio It would be great if it supports pagination. any updates?

kbala-ami avatar May 25 '19 10:05 kbala-ami

Hi ! Any update about this ?

Christopher2K avatar Sep 17 '19 18:09 Christopher2K