Skip to content

Instantly share code, notes, and snippets.

@dabit3
Created May 8, 2020 20:55
Show Gist options
  • Save dabit3/4aa84f9b7d453a093cf8e99c1166a798 to your computer and use it in GitHub Desktop.
Save dabit3/4aa84f9b7d453a093cf8e99c1166a798 to your computer and use it in GitHub Desktop.
DynamoDB update expression in VTL
{
"version": "2018-05-29",
"operation": "UpdateItem",
"key" : {
"id" : $util.dynamodb.toDynamoDBJson($context.arguments.id)
},
"update": {
"expression" : "set #upvotes = #upvotes + :updateValue",
"expressionNames" : {
"#upvotes" : "upvotes"
},
"expressionValues" : {
":updateValue" : { "N" : 1 }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment