I'm using amplify with appsync, when I'm querying with model pagination limit=10 , it is returning 10 items exactly, but when I'm adding a filter to it, it is returning less than 10 items. Seems it is filtering items form first 10 items, instead of returning 10 items satisfying the filter condition and my second issue issue how to sort whole dynamoDB table items, example I want the list of post with highest likes in current week in descending order how to do that in appsync & amplify?
Hi Sakar, Thank you for your comment. In order to do sorted pagination, you should use the 'ScanIndexForward' parameter of the query function. For instance, do a paginated query that sorts on your range key in descending order would be: response = table.query(KeyConditionExpression=Key('CountryName').eq('USA'), ScanIndexForward=false, ExclusiveStartKey=key). Simply swap the ScanIndexForward value to true for ascending order. Hope this helps.
I'm using limit in my rows and I want to be able to access directly the second/third page without the need to make the first request for the evaluatedKey value. Is this possible?
Great content and explanation !!! Just one doubt - if my table is having 10 data and all collectively is less than 1MB. If i query with page size = 10, what should be my lastEvaluatedKey?? Is it null or non-null ??
Thank you for this, Daniel. Any good references or resources on how to pull and display this data with Javascript and CSS? I'm not a frontend guy so I'm struggling with that.
Thanks for this. More DynamoDb content please. Nicely done!!!
Thanks Glenn! Glad you enjoyed. More DynamoDB content coming soon :)
Very well explained! Simple to understand and than implement...Thanks for sharing this
Very well explained! I always wanted to know how this function was implemented on many of the websites that I have visited.
Thanks Cedrick!
Very helpful for beginners like me, thank you
I'm using amplify with appsync, when I'm querying with model pagination limit=10 , it is returning 10 items exactly, but when I'm adding a filter to it, it is returning less than 10 items. Seems it is filtering items form first 10 items, instead of returning 10 items satisfying the filter condition and my second issue issue how to sort whole dynamoDB table items, example I want the list of post with highest likes in current week in descending order how to do that in appsync & amplify?
Hey @ThinQ , Did you manage to fix this issue? We are having the same issue on our side
@@LAVOTODGJORCE yup
Thanks for this wonderful video on DynomaDB pagination. Can you please explain how
to sort the records, before doing pagination.
Hi Sakar,
Thank you for your comment. In order to do sorted pagination, you should use the 'ScanIndexForward' parameter of the query function. For instance, do a paginated query that sorts on your range key in descending order would be: response = table.query(KeyConditionExpression=Key('CountryName').eq('USA'), ScanIndexForward=false, ExclusiveStartKey=key).
Simply swap the ScanIndexForward value to true for ascending order.
Hope this helps.
Thanks, have god day and good health.
Well explained, can we modify the lastEvaluatedKey to point to a specific record?
Thanks for explained, but I have a doubt, how do you set the QueryPageSize, does it refer to the limit?
Excellent content, thanks for sharing. How to apply sort with pagination?
Thank you very much, it was very helpful
I'm using limit in my rows and I want to be able to access directly the second/third page without the need to make the first request for the evaluatedKey value. Is this possible?
Great content and explanation !!! Just one doubt - if my table is having 10 data and all collectively is less than 1MB. If i query with page size = 10, what should be my lastEvaluatedKey?? Is it null or non-null ??
Hi Nitesh, it would be null. Hope this helps.
Thank you for sharing it. How to get "previous" page in DynamoDB?
do you know ?
Maintain state (keys) in front-end. Use the stored keys in reverse order to paginate backwards.
I'm using dynamoose, do you consider it to be a good option?
awesome explanation
Thank you for this, Daniel. Any good references or resources on how to pull and display this data with Javascript and CSS? I'm not a frontend guy so I'm struggling with that.
Is this applicable to Scan as well?
Great explanation.
Glad it was helpful!
Really a good video!!
Hi, thanks for sharing such a great video. I wonder if there is a way to scan the dynamodb table with pagination like get /users?page=5&limit=20 ?
Hi ingchau, you could certainly implement this yourself but out of the box it isnt supported by Dynamo :(
What if I insert T1' after returning T1 - T5?
Somebody have an example using NodeJS, I try use pageSize, page to give a limit and offset to integrate it in Angular. Please help me :)