PynamoDB icon indicating copy to clipboard operation
PynamoDB copied to clipboard

Adding new items in MapAttribute

Open ViachaslauKabak opened this issue 3 years ago • 0 comments

Hi, have a structure below. would like to add new key to the map structure but by the update operation below - only can rewrite. May be someone knows how to add keys to the mapattribute?

Could do add with boto3 but not with pynamo.

`class CustAttribute(MapAttribute): name = UnicodeAttribute(null=True) members = ListAttribute(null=True)

class TestTable(Model): class Meta: """Meta for this class.""" table_name = TName region = REGION

key_name = UnicodeAttribute(hash_key=True)
c_attr = MapAttribute(of=CustAttribute, default={})

group_name = 'qwerty' group_attr = {group_name: []}

TestTable( key_name=p_name, ).update( actions=[ TestTable.c_attr.set({group_name:group_attr}),

],

)`

ViachaslauKabak avatar Mar 17 '22 13:03 ViachaslauKabak