Created
May 30, 2016 05:36
-
-
Save torstenwerner/f678f1818e6750ed0198864a64e5b2ae 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
const params = { | |
TableName: table, | |
Key: { | |
"year": year, | |
"title": title | |
}, | |
UpdateExpression: "set info.rating = :r, info.plot=:p, info.actors=:a", | |
ExpressionAttributeValues: { | |
":r": 5.5, | |
":p": "Everything happens all at once.", | |
":a": ["Larry", "Moe", "Curly"] | |
}, | |
ReturnValues: "UPDATED_NEW" | |
}; | |
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, null, 2)); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
error message:
Object literal may only specify known properties, and 'UpdateExpression' does not exist in type 'UpdateParam'.