TuanVM
TuanVM

Reputation: 1

Update GSI of DynamoDB, old data not update in new GSI

I have one table, name is Ticket

Ticket { id, usage, affiliationOrganization createdAt, .... }

GSI1: PartionKey: usage SortKey: affiliationOrganization

After a development time, i want update SortKey of GSI1 PartionKey: usage SortKey: affiliationOrganization#createdAt

But after modifying the GSI, the old data is no longer in this GSI table. Only when adding new data will these new data be automatically typed into the GSI table.

(My english is stupid, I'm sorry if I wrote it wrong)

I want to automatically update old data to GSI after it is modified Avoid data loss in GSI table, query is not missing data

Upvotes: 0

Views: 649

Answers (1)

Leeroy Hannigan
Leeroy Hannigan

Reputation: 19903

The old data will automatically replicate to the GSI should it be eligible. Please ensure all your old items have an attribute named affiliationOrganization#createdAt.

Note that this must be a single attribute, DynamoDB does not combine attributes automatically, you must do so manually.

Upvotes: 0

Related Questions