Boto3 updating multiple values Boto3 updating multiple values python python

Boto3 updating multiple values


Yes, that's the way to do. Even many actions can be done in single expression as shown here. For ex: multiple 'PUT' and 'DELETE' in single expression.

Snapshot showing the example from document


For others finding this, theres a library you can use to help with the weird boto3 stuff like ExpressionAttributeValues. This way you can make normal developer/human calls.

https://github.com/rayepps/dynamof

db(update(  table_name='users',  key={ 'id': item['id'] },  attributes={      'age': 26,      'name': 'Carl'  }))

disclaimer: I wrote it