0
C# 용 AWS SDK로 항목을 업데이트하려면 어떻게해야합니까?DynamoDB에서 목록의 항목을 업데이트하는 방법은 무엇입니까?
ItemName이 "eqq"일 때 "선택됨"값을 "TRUE"로 업데이트하려고합니다. DynamoDB의 테이블에
request = {
ExpressionAttributeNames = new Dictionary<string, string>()
{
{"#I", "Items"},
{"#lN", item.ItemName}
},
ExpressionAttributeValues = new Dictionary<string, AttributeValue>()
{
{ ":item", new AttributeValue
{ L = new List<AttributeValue> {
{ new AttributeValue
{ M = new Dictionary<string,AttributeValue> {
{ "ListName", new AttributeValue { S = "item.ItemName"} },
{ "Selected", new AttributeValue { BOOL = item.Selected} },
{ "ImageSource", new AttributeValue { S = item.ImageSource} }
}}
}
}}
}
},
UpdateExpression = "SET #I.#lN = :item"
// UpdateExpression = "SET #I = list_append(:item,#I)"
// UpdateExpression = "SET #I = :item"
};
var response = await client.UpdateItemAsync(request);
내 JSON 데이터는 아래의 구조 다음과 같습니다 :
나는 성공없이이 코드를 작성{
"Items": [
{
"ImageSource": "checked.png",
"ItemName": "egg",
"Selected": true
},
{
"ImageSource": "checked.png",
"ItemName": "Water",
"Selected": true
}
],
"ListCategory": "Technology",
"ListCreator": "John",
"ListId": "e5a7ec9d-b00c-41f3-958a-84c8c183d702",
"ListName": "Test5",
"UpdateDateTıme": "2017-05-05T21:48:41.833Z"
}
고맙습니다. 훌륭한 아이디어입니다. :) 이것은 내가 찾고있는 것입니다. –