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ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ