DynamoDB add String Set of 0,1,0, get error Input collection [0, 1, 0] contains duplicates

0

I am attempting to create a matrix using a 3-string set. In each set, the value for {0} will relate to each of the 3 string set, same for a value of {1} and {2}. When entering test data into the console where I am creating the attributes, I receive an error on the 2nd of the string sets when I initialize the values to [0, 1, 0] . Why is this entry not valid and why is the error of: contain duplicates?

To be clear:

  • SS1 can contain values of: [ "2","3","22"]. - Containing Account ID's
  • SS2 can contain values of: ["0","1","0"] - Containing status of an item related to an account
  • SS3 can contain values of: ["1","1","0"] - Containing status of an item related to an account SS2 & SS3 are effectively a boolean, 1 or a 0.

Is this not allowed?

Thanks in advance.

profile picture
Petrus
已提問 2 個月前檢視次數 110 次
1 個回答
0

You are using a Set which has the following properties, importantly items in a set must be unique:

DynamoDB supports types that represent sets of number, string, or binary values. All the elements within a set must be of the same type. For example, a Number Set can only contain numbers and a String Set can only contain strings.

There is no limit on the number of values in a set, as long as the item containing the values fits within the DynamoDB item size limit (400 KB).

Each value within a set must be unique. The order of the values within a set is not preserved. Therefore, your applications must not rely on any particular order of elements within the set. DynamoDB does not support empty sets, however, empty string and binary values are allowed within a set.

profile pictureAWS
專家
已回答 2 個月前
  • Thank you for the clarity

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

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

回答問題指南