Add or remove an entry from a List type attribute in a DynamoDB table item

后端 未结 3 803
忘了有多久
忘了有多久 2020-12-04 02:14

I have a very simple class, with a string type primary key and List type attributes. I want to write an API for adding and removing an item from the attribute list, and savi

3条回答
  •  广开言路
    2020-12-04 02:27

    I just read the UpdateItem API thoroughly which talks about deleting set type attributes:

    DELETE - Removes the attribute and its value, if no value is specified for DELETE. The data type of the specified value must match the existing value's data type.If a set of values is specified, then those values are subtracted from the old set. For example, if the attribute value was the set [a,b,c] and the DELETE action specifies [a,c], then the final attribute value is [b]. Specifying an empty set is an error.

提交回复
热议问题