Database Reference
In-Depth Information
};
var response = dynamodbClient.GetItem(request);
Update item
The update item API allows us to add a new attribute to an existing set, delete an attribute
from an existing set, or add a new attribute to an item. It can be done using the following
code:
var request = new UpdateItemRequest
{
TableName = "Book",
Key = new Dictionary<string,AttributeValue>() { {
"bookId", new AttributeValue { N = "2001" } } },
AttributeUpdates = new Dictionary<string,
AttributeValueUpdate>()
{
// Add two new author to the list.
{ "authors",
new AttributeValueUpdate
{
Action="ADD",
Value = new AttributeValue{SS = { "XYZ",
"PQR" }}
}
},
// Increase the number of chapters by 2
{ "chapters",
new AttributeValueUpdate
{
Action="ADD",
Value = new AttributeValue{N = "2"}
}
},
// Add a new attribute.
{ "pages",
new AttributeValueUpdate { Value = new
AttributeValue{N = "180" } } },
Search WWH ::




Custom Search