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 Answer
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
EXPERT
answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions