Forum Discussion
how to create a query that paginates?
Sorry, I was not clear in my comment. I'm trying to point out that the code does not paginate as expected.
If a dataset has more record than the limit, the next page should have the records that follow the previous page, until all records are loaded. lastKey from the first load has the start value for the next "page".
As you pointed out, there are over 700 records, but the the code returns only the first page.
If you run the query without 'limit' parameter, 50 records (that's the default) will be return. The code should use lastKey to pull the next page, but it doesn't.
Do you have any ideas what could be the problem with the code?
How many records to you expect? (unique id's)
- kroll9 years agoFrequent Visitor
Imke, I had a feeling that there was a disconnect between what we were seeing...
The bottom line - you are GREAT, and your code is correct, and I appreciate your help VERY MUCH!
Thank you!!!
More details, in case others repeat my mistake...
Regardless of the setting on 'limit=', the returned number of records is the same. Basically, your query works exactly as expected!
My confusion was caused by the fact that expanding content of the 'Error' in the initial table would show the records pulled by the first pass (w/o pagination).
I should have paid more attention to your instructions "just expand the record (& ignore the error-message for a start): Transfer the list to a table & then you can expand the records you need.".
It works great.
Once again, THANK YOU!!!