I have a string field, "title". I am trying to update it with the update expression with
persontable.update_item(Key={'person_id':person_id}, UpdateExpression="SET title = UPDATED")
and I get
An error occurred (ValidationException) when calling the UpdateItem operation: The provided expression refers to an attribute that does not exist in the item
I can see the attribute "title" for that person in the AWS console. What gives?
Don't plug the value into the expression directly. Rather use ExpressionAttributeValues -- see boto3 guide
persontable.update_item(Key={'person_id':person_id},
UpdateExpression="SET title = :updated",
ExpressionAttributeValues={':updated': 'UPDATED'})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With