Created
January 22, 2023 19:10
-
-
Save RafalWilinski/1d7748f5746a5318910793e1591a2aad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// First, get the item | |
DynamoDB.get({ | |
TableName: "http-crud-tutorial-items", | |
Key: { | |
id: "1", | |
}, | |
}).promise().then((data) => { | |
const item = data.Item; | |
// Update the item | |
DynamoDB.put({ | |
TableName: "http-crud-tutorial-items", | |
Item: { | |
...item, | |
assets: { | |
...(item.assets || {}), | |
token: { | |
quantity: "3", | |
}, | |
}, | |
}, | |
}).promise().then(() => { | |
console.log('Updated item') | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment