Add new attribute column to existing DynamoDB item record

Last modified date

Comment: 1


Imagine you have a table in DynamoDb that looks like this:

name is the primary key

Now what if you wanted to add another attribute to a record in the table:

name is the primary key

You need to use the UpdateExpression and SET function to add the extra address attribute to the record.

Adding New Attribute

To add a new attribute column, use the UpdateExpression along with SET to add the new attribute.

Assume that we have already done the Table setup.

SET attribute is used to add a new attribute to an existing item record.

There are other Update Expressions that can be found in the references section below.

Handling Reserved Characters

In order to add new attribute names that contain reserved characters like hyphens, placeholders have to be used instead.

Placeholders can be alphanumeric.

Use # placeholder for attribute name and : placeholder for values.


Update Item –

Update Expressions –

Expression Attribute Names –

Expression Attribute Values –

Update Item Spec API Docs –


1 Response

  1. Pingback: DynamoDB - JakTech

Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.