I need help with figuring out how to format my Key in lambda to update an item in DynamoDB. Below is the code I have but I can't figure out how to format the Key.
My table looks as follows:
'''
import json import boto3
dynamodb = boto3.resource('dynamodb')
client = boto3.client('dynamodb')
def lambda_handler(event, context):
response = client.update_item(
TableName='hitcounter',
Key={????????},
UpdateExpression='ADD visits :incr',
ExpressionAttributeValues={':incr': 1}
)
print(response)
'''
ERROR MESSAGE:
''' { "errorMessage": "'path'", "errorType": "KeyError", "stackTrace": [ " File \"/var/task/lambda_function.py\", line 11, in lambda_handler\n Key={'path': event['path']},\n" ] }
'''