Global secondary indexes null partition key

0

Hi,
I've been digging around but I don't seem to find anything that could help me.
Basically, I created an index for my table and I'd like to keep adding objects to the original table even if the index partition key (let's call it index_id) is not specified. It does not seem possible, yet when I created the index, some of the previous items did not have index_ids and they were just ignored by the index. Is there a way to do this for future items added to the table ?

Thanks

已提問 7 年前檢視次數 2978 次
1 個回答
0

Hi mszniber,

"For any item in a table, DynamoDB will only write a corresponding entry to a global secondary index if the index key value is present in the item. For global secondary indexes, this is the index partition key and its sort key (if present). If the index key value(s) do not appear in every table item, the index is said to be sparse."

That is to say, if the item does not have the attribute which you choose to be the partition key of your GSI, it will not show in your GSI table.

Please refer to the following link regarding this for more details:
http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GuidelinesForGSI.html#GuidelinesForGSI.SparseIndexes

AWS
已回答 7 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南