zgcharley
zgcharley

Reputation: 1084

Can update the HASH key to another attribute for a pre-existing Dynamodb global secondary index?

Having an existing GSI with key (HASH: user, RANGE: date), can I update the key to (HASH: group, RANGE: date) without creating a new index?

The group attribute is an existed attribute i table and also projected into the GSI already.

Upvotes: 1

Views: 753

Answers (1)

mtstrong17
mtstrong17

Reputation: 136

No, DynamoDB does not support changing the HASH and RANGE values for tables or indexes, if you need them changed you will have to create a new GSI with the desired values and remove the old one.

Extra: If you hav't already i would highly suggest watching this video about DynamoDB design patterns it might provide useful insight that may help up down the line.

Upvotes: 1

Related Questions