Ich versuche, ein Element in DynamoDB Tabelle zu aktualisieren:DynamoDB Update Artikel Multi Aktion
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
});
Es funktioniert. Aber ich will noch mehr Wert setzen (reset_time =: Wert ') wie folgt aus:
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
});
Kann Unterstützung Multi Aktion in einer Abfrage DynamoDB?
Darf ich um die Antwort bitten, wenn es nützlich ist? Vielen Dank! – notionquest