I defined a DynamoDB updateItem params variable like this:
params0 = {
TableName: 'FHCRoomCounts',
Key: {
timeSlot: '0830',
room: 'chapel',
},
UpdateExpression: 'ADD registrants :n',
ExpressionAttributeValues: {
':n' : 1,
}, // end ExpressionAttributeValues
ReturnValues: 'ALL_NEW'
}; // end params0 = { ... }
Logged to the console in response was a message noting 13 validation errors. That message is reproduced below.
This is a minimal case for purposes here. Ultimately, what I want to do is capture the form data on a form submit event (done that) and programmatically update the table using that data. But first, I have to master a simple updateItem using a params definition written by hand.
Can anyone direct a novice to the error(s) in the params0 definition? Any help sure would be appreciated.
--The Error Message Logged To The Console--
The Answer
Note:
Edit: 2019.06.127:
After spending seemingly a decade immersed in the DynamoDB API documentation, I finally figured out the answer. I have deleted the error messages originally appearing here and instead I enter the answer.
params0 = {
'TableName': 'FHCRoomCounts',
'Key': {
'timeSlot': {
'S': '0830'
},
'room': { 'S': 'chapel'
}
},
'ExpressionAttributeValues': {
':n': {'N': '1'},
},
'UpdateExpression':'ADD registrants :n',
'ReturnValues': 'ALL_NEW',
};
Edited by: alxfyv on Jun 17, 2019 12:22 AM