dynamodb query im trying to get some data from dynamodb using laravel

2.6k Views Asked by At

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

1

There are 1 best solutions below

1
Shay Ashkenazi On

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.