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
gefragt vor 5 Jahren228 Aufrufe
1 Antwort
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
beantwortet vor 5 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen