Last active
April 5, 2019 09:55
-
-
Save organizm/bf1ce550f80698e2a76f05c9c91eb72b to your computer and use it in GitHub Desktop.
[Remove nested attribute in DynanmoDB]#DynanmoDB
This file contains hidden or 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
let docClient = new AWS.DynamoDB.DocumentClient(); | |
let params = { | |
TableName : "customer", | |
Key : { | |
"customerId": "customer_001" | |
}, | |
UpdateExpression : "REMOVE address.street3", | |
ReturnValues : "UPDATED_NEW" | |
}; | |
console.log("Updating the item..."); | |
docClient.update(params, function(err, data) { | |
if (err) { | |
console.error("Unable to update item. Error JSON:", JSON.stringify(err, null, 2)); | |
} else { | |
console.log("UpdateItem succeeded:", JSON.stringify(data)); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment