Database Reference
In-Depth Information
Updating a record
In the same way, if you want to update a record in table you can try the PutItem API ac-
tion. You can use any value type; so choose an attribute in the item. However, by mixing
and matching attribute types, you will be able to select the required one.
Android
The following code is used to update a record for Android:
Map<String,AttributeValue> item = new HashMap<String,
AttributeValue>();
item.put("BookId",
new AttributeValue().withN("4321"));
item.put("RecordId",
new AttributeValue().withS("FavoriteBooks"));
item.put("Data",
new AttributeValue().withSS("Computer", "Science",
"Physics"));
PutItemRequest putItemRequest = new
PutItemRequest("BookTableExample", item);
// process the request
PutItemResult putItemResult =
ddbClient.putItem(putItemRequest);
iOS
The following code is used to update a record for iOS:
DynamoDBPutItemRequest *putItemRequest =
[DynamoDBPutItemRequest new];
request.tableName = @"BookTableExample";
DynamoDBAttributeValue *value =
[[DynamoDBAttributeValuealloc] initWithN:@"4321"];
Search WWH ::




Custom Search