Skip to content

Latest commit

 

History

History
49 lines (33 loc) · 754 Bytes

AWS DynamoDB.md

File metadata and controls

49 lines (33 loc) · 754 Bytes
tags aliases cssclass
📝/🌱

[[AWS DynamoDB]]


  • 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: