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

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달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠