Database Reference
In-Depth Information
Deleting an item
To delete an item, we need to provide the key details for the given item in the delete item
request and invoke the same request as follows.
Android
Here is a code sample that explains how to delete an item from a DynamoDB table:
// create a map, specifying the key attributes of the item
to be deleted
Map<String,AttributeValue> key = new
HashMap<String,AttributeValue>();
key.put("productId", new AttributeValue().withN("123"));
key.put("recordId", new
AttributeValue().withS("productName"));
// create delete item request
DeleteItemRequest deleteItemRequest = new
DeleteItemRequest("ProductTable", key);
// invoke the request
DeleteItemResult deleteItemResponse =
ddbClient.deleteItem(deleteItemRequest);
iOS
Here is a syntax to delete an item from a DynamoDB table using an iOS SDK:
// create delete item request
DynamoDBDeleteItemRequest *deleteItemRequest =
[DynamoDBDeleteItemRequest new];
request.tableName = @"ProductTable";
Search WWH ::




Custom Search