DynamoDB updateItem: validation errors in params definition (novice here)

0

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

alxfyv
asked 5 years ago224 views
1 Answer
0

As noted in the Edit, I discovered the answer. Rather than delete the question, I thought to let it stand with the answer in it in case it might be useful to someone else.

alxfyv
answered 5 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions