DeleteAttributes

Description

Deletes one or more attributes associated with the item. If all attributes of an item are deleted, the item is deleted.

[Note]Note

If you specify DeleteAttributes without attributes or values, all the attributes for the item are deleted.

DeleteAttributes is an idempotent operation; running it multiple times on the same item or attribute does not result in an error response.

Because Amazon SimpleDB makes multiple copies of your data and uses an eventual consistency update model, performing a GetAttributes or Select request (read) immediately after a DeleteAttributes or PutAttributes request (write) might not return the updated data.

Request Parameters

Name Description Required
ItemName

The name of the item.

Type: String

Yes

Attribute.X.Name (REST)

<Attribute><Name>... </Name></Attribute> (SOAP)

The name of the attribute.

Type: String

No

Attribute.X.Value (REST)

<Attribute><Value>... </Value></Attribute> (SOAP)

The name of the attribute value (for multi-valued attributes).

Type: String

No
DomainName

The name of the domain in which to perform the operation.

Type: String

Yes

Response Elements

See Common Response Elements.

Special Errors

Error Description
InvalidParameterValue Value (" + value + ") for parameter Name is invalid. Value exceeds maximum length of 1024.
InvalidParameterValue Value (" + value + ") for parameter Value is invalid. Value exceeds maximum length of 1024.
InvalidParameterValue Value (" + value + ") for parameter Item is invalid. Value exceeds max length of 1024.
MissingParameter The request must contain the parameter DomainName.
MissingParameter The request must contain the parameter ItemName.
NoSuchDomain The specified domain does not exist.

Examples

Sample Request

In this example, the Jumbo Fez sold out in several colors. The following deletes the red, brick, and garnet values from the color attribute of the JumboFez item.

https://sdb.amazonaws.com/
?Action=DeleteAttributes
&Attribute.0.Name=color
&Attribute.0.Value=red
&Attribute.1.Name=color
&Attribute.1.Value=brick
&Attribute.2.Name=color
&Attribute.2.Value=garnet
&AWSAccessKeyId=[valid access key id]
&DomainName=MyDomain
&ItemName=JumboFez
&SignatureVersion=2
&SignatureMethod=HmacSHA256
&Timestamp=2007-06-25T15%3A03%3A07-07%3A00
&Version=2009-04-15
&Signature=[valid signature]

Sample Response

<DeleteAttributesResponse xmlns="http://sdb.amazonaws.com/doc/2009-04-15">
  <ResponseMetadata>
    <RequestId>05ae667c-cfac-41a8-ab37-a9c897c4c3ca</RequestId>
    <BoxUsage>0.0000219907</BoxUsage>
  </ResponseMetadata>
</DeleteAttributesResponse>