Devin
05/13/2022, 2:51 PMpk: 'some-pk'
sk: 'unique-id'
active: true
name: 'cool name'
pk: 'some-pk'
sk: 'another-unique-id'
active: true
name: 'some other name!'
I have another item that’s essentially a variable grouping of those items
pk: 'bundle'
sk: 'unique-bundle-name'
bundle: ['unique-id', 'another-unique-id']
I want to “add” a bundle to a customers orders. like…
// pseudocode
for (const bundle in bundles) {
const item = await dynamoDb.get(bundle) // get the item by sk
await dynamoDb.put({...item, customerId }) // put that value into dynamo
}
Should I just do that? Another thing I could do is get each item, then transact write the whole batch. I mostly don’t know a good way to do something for a “group” of items.
Articles/ideas welcome.Adam Fanello
05/13/2022, 2:54 PMDevin
05/13/2022, 2:58 PMDevin
05/13/2022, 2:58 PMDerek Kershner
05/13/2022, 3:05 PMDevin
05/13/2022, 3:09 PM