How to Add a Column in DynamoDB

后端 未结 4 1294
無奈伤痛
無奈伤痛 2021-01-31 00:47

Is there a way to add a new column to existing table in DynamoDB in Amazon\'s AWS?

Google didn\'t help,

UpdateTable Query in http://docs.aws.amazon.com/cli/lat

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-31 01:46

    I installed NoSQL Workbench then connected to existing DynamoDB Table and tried to update existing Item by adding a new attribute. I figured out that we can only add a new attribute with one of these types - "SS", "NS", "BS" (String Set, Number Set, Binary Set"). In Workbench, we can generate code for the chosen operation.

    I scanned my dynamodb Table and for each item added new attribute with type "SS" then I scanned again and updated recently added new attribute to type - "S" in order create a global secondary index (GSI) with a primary key - "pk2NewAttr".

    NoSQL Workbench related video - https://www.youtube.com/watch?v=Xn12QSNa4RE&feature=youtu.be&t=3666

    Example in Python "how to scan all dynamodb Table" - https://gist.github.com/pgolding

提交回复
热议问题