- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

JSON Pagination based on has_more
I have a JSON WEB Document that, when there is no limiting, it brings me the following values:
{"data":[{"index":5,"value":"F"},{"index":6,"value":"G"},{"index":7,"value":"H"},{"index":8,"value":"I"},{"index":9,"value":"J"},{"index":10,"value":"K"},{"index":11,"value":"L"},{"index":12,"value":"M"},{"index":13,"value":"N"},{"index":14,"value":"O"},{"index":15,"value":"P"},{"index":16,"value":"Q"},{"index":17,"value":"R"},{"index":18,"value":"S"},{"index":19,"value":"T"},{"index":20,"value":"U"},{"index":21,"value":"V"},{"index":22,"value":"W"},{"index":23,"value":"X"},{"index":24,"value":"Y"},{"index":25,"value":"Z"}],"has_more":false}
When I limit the query to five values, it brings me the following JSON:
{"data":[{"index":0,"value":"A"},{"index":1,"value":"B"},{"index":2,"value":"C"},{"index":3,"value":"D"},{"index":4,"value":"E"}],"has_more":true}
So, when there is more data below the last value, the "has_more" returns TRUE, and when there is not, it returns FALSE. I have a statement start_at (which index number should the query start), and another limit, that I can maybe use to paginate and create functions based on the value of has_more.
The result should bring the 25 values, but each query list should not have more than 5 values.
