I have tried all methods mentioned in many different docs of aws dynamoDB. like this and this.
Also referred to this post.
But it just doesn't seem to work.
I have this entry in dynamoDB:
dict1={
'token':1234567890,
'name':'bigCompany',
'nestedDict':{
'a':3810,
'b':3815,
'c':3805,
'd':3811
},
'High1':3815,
'Low1':3805
}
And i'm using this code to update an attribute:
updater = table.update_item(
Key={
'token': '1234567890',
'name':'bigCompany'
},
ExpressionAttributeNames={'#LM':'Low1'},
ExpressionAttributeValues={
':nlm': {
'N':'3802'
}
},
ReturnValues='UPDATED_OLD',
UpdateExpression='SET #LM = :nlm',
)
This is the stack trace:
Traceback (most recent call last):
File "updating1.py", line 89, in <module>
UpdateExpression='SET #LM = :nlm',
File ".local/lib/python3.7/site-packages/boto3/resources/factory.py", line 520, in do_action
response = action(self, *args, **kwargs)
File ".local/lib/python3.7/site-packages/boto3/resources/action.py", line 83, in __call__
response = getattr(parent.meta.client, operation_name)(*args, **params)
File ".local/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
return self._make_api_call(operation_name, kwargs)
File ".local/lib/python3.7/site-packages/botocore/client.py", line 676, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the UpdateItem operation: The provided key element does not match the schema
What am i missing here.