PutAttributes

The PutAttributes operation creates or replaces attributes in an item. You specify new attributes using a combination of the Attribute.X.Name and Attribute.X.Value parameters. You specify the first attribute by the parameters Attribute.0.Name and Attribute.0.Value, the second attribute by the parameters Attribute.1.Name and Attribute.1.Value, and so on.

Attributes are uniquely identified in an item by their name/value combination. For example, a single item can have the attributes { "first_name", "first_value" } and { "first_name", second_value" }. However, it cannot have two attribute instances where both the Attribute.X.Name and Attribute.X.Value are the same.

Optionally, the requestor can supply the Replace parameter for each individual attribute. Setting this value to true causes the new attribute value to replace the existing attribute value(s). For example, if an item has the attributes { 'a', '1' }, { 'b', '2'} and { 'b', '3' } and the requestor calls PutAttributes using the attributes { 'b', '4' } with the Replace parameter set to true, the final attributes of the item are changed to { 'a', '1' } and { 'b', '4' }, which replaces the previous values of the 'b' attribute with the new value.

[Note]Note

Using PutAttributes to replace attribute values that do not exist will not result in an error response.

The following limitations are enforced for this operation:

  • 100 attributes per each call

  • 256 total attribute name-value pairs per item

  • 250 million attributes per domain

  • 10 GB of total user data storage per domain

Name Description Required?
Attribute.X.Name

The name of the attribute.

Type: String.

Yes
Attribute.X.Value

The value of the attribute.

Type: String.

Yes
ItemName

The name of the item.

Type: String.

Yes
Attribute.X.Replace

Flag to specify whether to replace the Attribute/Value or to add a new Attribute/Value. The default setting is false.

Type: String.

No
DomainName

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

Type: String

Yes
[Note]Note

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

See Common Response Elements.

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.
InvalidParameterValue Value (" + value + ") for parameter Replace is invalid. The Replace flag should be either true or false.
MissingParameter The request must contain the parameter DomainName.
MissingParameter The request must contain the parameter ItemName.
MissingParameter Attribute.Value missing for Attribute.Name='<attribute name>'.
MissingParameter Attribute.Name missing for Attribute.Value='<attribute value>'.
NoSuchDomain The specified domain does not exist.
NumberItemAttributesExceeded Too many attributes in this item.
NumberDomainAttributesExceeded Too many attributes in this domain.
NumberDomainBytesExceeded Too many bytes in this domain.