Writing data · Lesson 8 of 20
PutItem replaces
PutItem writes a whole item and overwrites any item with the same key.
Why
PutItem writes an entire item. If the key is new, you get a new item. If an item with that key already exists, PutItem replaces it wholesale: it does not merge.
Add a track, then overwrite track 001 with a version that drops the seconds attribute. Look at the row: the old attribute did not survive. That is the footgun and the feature.
PutItem is write-or-replace by key. To change part of an item without losing the rest, use UpdateItem.
Playlistsdynoxide · wasm · DynamoDB API 2012-08-10 · contract 1
Try an example
A new key, so a new item appears in the Chill playlist.
pk(pk)
sk(sk)
name
owner
title
seconds
Run an operation to see the raw engine response.
table Playlistskeys pk / skitems 26