3

Let's say in my main table I have objects that have the following pattern :

Partition Key = user_user@email.com
Range Key = project_001
Role = owner

It's a simple object that says what is the role if a specific user in a specific project.

But then I want to get all user roles in a project, so I made a GSI that inverts the key orders by using Range Key Begins With "user_"

Partition Key = project_001
Range Key = user_user@email.com
Role = owner

But what happens when I delete a object in this GSI? Will it delete the respective object it replicated from the main table? Or do I need to manually keep them synchronized?

Mojimi
  • 2,561
  • 9
  • 52
  • 116

1 Answers1

4

You can't delete via a GSI.

DeleteItem() only accepts the table name.

That will cascade down to the GSI.

Charles
  • 21,637
  • 1
  • 20
  • 44