Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update attribute "timestamp" reserved word

You can work around this problem using expression attribute names (similar to the ExpressionAttributeValues you are already using).

table.update_item(
  Key={
    'id': item_id
  },
  UpdateExpression='SET #ts = :val1',
  ExpressionAttributeValues={
    ":val1": new_timestamp
  },
  ExpressionAttributeNames={
    "#ts": "timestamp"
  }
)

Read all about it here: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ExpressionAttributeNames.html


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!