如何将项目追加到DyDoDB中的现有映射中
发电机的结构如下
{
"user": "xyz",
"itemdetails": [
{
"location": "67666",
"name": "item1",
"tags": [
"k7866"
]
},
{
"location": "45444",
"name": "item12",
"tags": [
"ha23",
"ju4532"
]
}
}
我试过下面的但是
函数;运算符:ADD,操作数类型:MAP“
response = table.update_item(
Key={
'user': "xyz",
},
UpdateExpression = 'ADD #itemdetails :newItems',
ExpressionAttributeNames = {
'#itemdetails' : 'ids'
},
ExpressionAttributeValues = {
':newItems' : {"name":name,
"location":location,
"tags":tags
}
},
ReturnValues="UPDATED_NEW"