I am trying to update an item in DynamoDB table:
var params = {
TableName: 'User',
Key: {
id: 'b6cc8100-74e4-11e6-8e52-bbcb90cbdd26',
},
UpdateExpression: 'ADD past_visits :inc, past_chats :inc',
ExpressionAttributeValues: {
':inc': 1
},
ReturnValues: 'ALL_NEW'
};
docClient.update(params, function(err, data) {
if (err) ppJson(err); // an error occurred
else ppJson(data); // successful response
});
It's working. But I want to set some more value (reset_time = :value') like this:
var params = {
TableName: 'User',
Key: {
id: 'b6cc8100-74e4-11e6-8e52-bbcb90cbdd26',
},
UpdateExpression: 'ADD past_visits :inc, past_chats :inc, SET reset_time = :value',
ExpressionAttributeValues: {
':inc': 1,
':value': 0
},
ReturnValues: 'ALL_NEW'
};
docClient.update(params, function(err, data) {
if (err) ppJson(err); // an error occurred
else ppJson(data); // successful response
});
Can DynamoDb support multi action in one query ?