tags | aliases | cssclass |
---|---|---|
📝/🌱 |
- When Adding or Updating items from the db, the attributes (if a Reserved Word ) must be configured correctly. Configuration includes using
ExpressionAttributeNames
like the following:
response = self.table.update_item(
Key={"partition-key": str(item_id)},
UpdateExpression="""
set #d = :d,
#n = :name,
""",
ExpressionAttributeNames={
"#d": "data",
"#n": "name",
},
ExpressionAttributeValues={
":d": data,
":name": data["name"],
},
ReturnValues="ALL_NEW",
)
return response["Attributes"]
Tags:
Reference:
Related:
🔗 Links to this page: