Is it not possible to add an attribute in dynamodb dynamically?
I am getting an error saying “The provided key element does not match the schema".
Scenario -
{ id : "123", imageName : "elephant.jpg" }
I want to add an attribute - imagePath : "/path/to/image" to the above data. I used put_item, but it replaces the old item if exists.
Adding an attribute can be achieved using put_item but it will replace the existing item. How can we dynamically add an attribute to the existing data using update_item?
Should I alter the schema of the table with imagePath and then use the update_item function?