I\'m trying to update an Item in my Dynamodb Table +Users+. I have tried many different ways but I always received the same error message:
The provided k
For others who have faced the same challenge and the issue is not fixed by above answers, it is always better to double check the data type of the value being updated, in my case the primary key was expecting a Number and I was trying to update with a string. Silly me
I was doing BatchGetItem
, then streamed it to BatchWriteItem
(Delete). DeleteItem
didn't like it got all attributes from the object instead of only partition and sort key.
Gathering all answers:
You are only providing half of your primary key. Your primary key is a combination of the partition key and range key. You need to include the range key in your Key
attribute in the update parameters.
My checklist when facing this issue:
@DynamoDBHashKey(attributeName = "userId")
in Java to indicate the partition key named userId
.Please, add more if you know in the comments.