0

I have a lambda function to fetch the items from dynamoDB. I have already set Limit: 100 but its not working and it gives the response as 413 - Payload Too Large.

Here is my code and I am using it with documentClient.query:

   {
      TableName: <tableName>,
      IndexName: <index-value>',
      ScanIndexForward: false,  
      KeyConditionExpression: '#status = :status',
      FilterExpression: filterExpression,
      ExpressionAttributeNames: {
        "#status": "status"
      },
      ExpressionAttributeValues: expressionAttributeValues,
      Limit: 100
    }; 

Kindly share your inputs.

Thank you.

Kiran Uppunda
  • 43
  • 1
  • 6
  • 1
    I doubt if the error is from query operation? A Query operation can retrieve a maximum of 1 MB of data. This limit applies before the filter expression is evaluated and will return fewer items when size is reached. If this query api is erroring, possibly check the "expressionAttributeValues" - this may have more values breaching API payload limit – omuthu Jun 04 '21 at 07:09
  • In my experience, the 413 Payload Too Large means that your **request**, not the response, was too large. Please try to print your request and see that it doesn't contain a huge amount of nonsense. – Nadav Har'El Jun 06 '21 at 08:06

0 Answers0