Step 4: Update data in a table
In this step, you update an item that you created in Step 2: Write data to a table using the console or Amazon CLI. You can
use the DynamoDB console or the Amazon CLI to update the AlbumTitle
of an item in
the Music
table by specifying Artist
, SongTitle
,
and the updated AlbumTitle
.
For more information about write operations, see Writing an item.
You can use the DynamoDB console to update data in the Music
table.
Open the DynamoDB console at https://console.amazonaws.cn/dynamodb/
. -
In the left navigation pane, choose Tables.
-
Choose the Music table from the table list.
-
Choose Explore table items.
-
In Items returned, for the item row with Acme Band Artist and Happy Day SongTitle, do the following:
-
Place your cursor on the AlbumTitle named Songs About Life.
-
Choose the Edit icon.
-
In the Edit String popup window, enter
Songs of Twilight
. -
Choose Save.
Tip
Alternatively, to update an item, do the following in the Items returned section:
-
Choose the item row with Artist named Acme Band and SongTitle named Happy Day.
-
From the Actions dropdown list, choose Edit item.
-
For enter AlbumTitle, enter
Songs of Twilight
. -
Choose Save and close.
-
The following Amazon CLI example updates an item in the Music
table.
You can do this either through the DynamoDB API or PartiQL, a SQL-compatible query
language for DynamoDB.
To query the data in the Music
table, proceed to Step 5: Query data in a table.