How do I retrieve all the items from DynamoDB in the AWS Amplify application?

0

I am using the AWS Amplify React application. While the app syncs the API to get all the items from the Dynamodb table, it returns only 100 items for that call. At that time, I set a limit of 5000, but it returned only 2088 items.

I will share the react code to get items from Dynamodb, and I will also share the code for the limit set in that API.

AppSyncApiCall

AppSyncApiCallWithLimit

Also, I will share the live count of my DynamoDB table items.

TableItemsCount

已提问 3 个月前157 查看次数
1 回答
0

You don't share how you have implemented your AdminlistProductLists resolver so its hard to help you. But from the images you are sharing there can be a number of possible causes:

  1. In the console you do a Scan, you may be doing a Query in your resovler.
  2. Your pagination is checking for an empty page to determine if it should paginate, however, you could be returned an empty page if using a filter. You need to check for the existence and non null value of nextToken.

If those don't answer your concern, then please share a code snippet which can be tested, and not in the form of an image.

profile pictureAWS
专家
已回答 3 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则