Container for the parameters to the DeleteItem operation.
Deletes a single item in a table by primary key.
You can perform a conditional delete operation that deletes the item if it exists, or if it has an expected attribute value.
Declaration Syntax
C# |
public class DeleteItemRequest : AmazonWebServiceRequest
Members
All Members | Constructors | Methods | Properties | ||
Icon | Member | Description |
---|---|---|
DeleteItemRequest()()()() | Initializes a new instance of the DeleteItemRequest class | |
Equals(Object) | (Inherited from Object.) | |
Expected |
Designates an attribute for a conditional modification. The Expected parameter allows you to provide an attribute name, and whether
or not Amazon DynamoDB should check to see if the attribute has a particular value before modifying it.
| |
GetHashCode()()()() | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType()()()() | Gets the type of the current instance. (Inherited from Object.) | |
Key |
The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute
(hash-and-range) primary key.
| |
ReturnValues |
Use this parameter if you want to get the attribute name-value pairs before or after they are modified. For PUT operations, the
possible parameter values are NONE (default) or ALL_OLD. For update operations, the possible parameter values are NONE
(default) or ALL_OLD, UPDATED_OLD, ALL_NEW or UPDATED_NEW.
Constraints: | |
TableName |
The name of the table in which you want to delete an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore),
- (hyphen) and . (period).
Constraints: | |
ToString()()()() | Returns a string that represents the current object. (Inherited from Object.) | |
WithExpected(array<KeyValuePair<(Of <<'(String, ExpectedAttributeValue>)>>)>[]()[][]) | Obsolete.
Adds the KeyValuePairs to the Expected dictionary.
| |
WithKey(Key) | Obsolete.
Sets the Key property
| |
WithReturnValues(String) | Obsolete.
Sets the ReturnValues property
| |
WithTableName(String) | Obsolete.
Sets the TableName property
|
Examples
This example shows how to delete an item in a table.
CopyDeleteItem sample
// Create a client AmazonDynamoDBClient client = new AmazonDynamoDBClient(); // Define item key // Hash-key of the target item is string value "Mark Twain" // Range-key of the target item is string value "The Adventures of Tom Sawyer" Key key = new Key { HashKeyElement = new AttributeValue { S = "Mark Twain" }, RangeKeyElement = new AttributeValue { S = "The Adventures of Tom Sawyer" } }; // Create DeleteItem request DeleteItemRequest request = new DeleteItemRequest { TableName = "SampleTable", Key = key }; // Issue request client.DeleteItem(request);
Inheritance Hierarchy
Object | ||
AmazonWebServiceRequest | ||
DeleteItemRequest |
See Also