Error: dynamodb list_append if_not_exists not working

Answered by Rafal Wilinski
What's Causing This Error
This is a generic error you may encounter when using the list_append
or if_not_exists
update expression functions. This error mainly occurs when you try to execute these two functions on child attributes where the parent does not exist.
const expression = SET #parent.#child = list_appends(if_not_exists(#parent.child,:emptyArray),:add))
The snippet below shows that a list item is appended to a property named child
in the parent
attribute.
However, if the parent
attribute does not exist when this expression gets executed, DynamoDB will throw an error.
Solution: Here's How To Resolve It
To resolve the error, ensure that the parent (top level) attribute exists in the item before managing a child attribute.
// ensure that the item has an attribute named parent #parent.#child
Other Common DynamoDB Errors (with Solutions)
- dynamodb scan missing values
- DynamoDB FilterExpression Not Working
- resourcenotfoundexception dynamodb nodejs
- DynamoDB Internal Server Error
- dynamodb net scan condition or not working
- amazon dynamodb query parentparams is not defined
- dynamodb query key condition not supported
- AWS DynamoDB errors ResourceNotFoundException
- com amazonaws services dynamodbv2 model resourcenotfoundexception
- dynamodb ttl not deleting / erasing items
- could not unconvert attribute dynamodb
- could not connect to the endpoint URL dynamodb
- aws.dynamodb.documentclient is not a constructor
- lambda function not triggering from dynamodb
- dynamodb: one or more parameter values were invalid: type mismatch for index key
Login to the AWS Console less. Use Dynobase.
Try 7-day free trial. No credit card needed.
Product Features
DynamoDB Tools
DynamoDB Info
© 2025 Dynobase