* add support for delete on update_with_attribute_updates
This commit is contained in:
parent
bbd7fefb37
commit
1088c421d2
2 changed files with 41 additions and 0 deletions
|
|
@ -294,6 +294,19 @@ class Item(BaseModel):
|
|||
# TODO: implement other data types
|
||||
raise NotImplementedError(
|
||||
'ADD not supported for %s' % ', '.join(update_action['Value'].keys()))
|
||||
elif action == 'DELETE':
|
||||
if set(update_action['Value'].keys()) == set(['SS']):
|
||||
existing = self.attrs.get(attribute_name, DynamoType({"SS": {}}))
|
||||
new_set = set(existing.value).difference(set(new_value))
|
||||
self.attrs[attribute_name] = DynamoType({
|
||||
"SS": list(new_set)
|
||||
})
|
||||
else:
|
||||
raise NotImplementedError(
|
||||
'ADD not supported for %s' % ', '.join(update_action['Value'].keys()))
|
||||
else:
|
||||
raise NotImplementedError(
|
||||
'%s action not support for update_with_attribute_updates' % action)
|
||||
|
||||
|
||||
class StreamRecord(BaseModel):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue