2

the query is work now but the problem is the attribute_not_exists when I added the attribute_not_exists the whole query not working.

error message: "One or more parameter values were invalid: Secondary (truncated...) ValidationException (client): One or more parameter values were invalid: Secondary index status-created_at-index does not project one or more filter attributes: [affiliate, agent, partner]"

enter image description here

Can some explain why? Thank you, I'm a newbie

hoangdv
  • 15,138
  • 4
  • 27
  • 48
mic_test
  • 121
  • 2
  • 13

1 Answers1

1

You haven't set projections for these three attributes (affiliate, agent, partner), when you created the secondary index.

You can see it in the output you've got:

Secondary index status-created_at-index does not project one or more filter attributes: [affiliate, agent, partner]

A projection is the set of attributes that is copied from a table into a secondary index. The partition key and sort key of the table are always projected into the index; you can project other attributes to support your application's query requirements.

You can learn more about this in Amazon DynamoDB Global Secondary Index Attribute Projections.

Shay Ashkenazi
  • 467
  • 1
  • 4
  • 11