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

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则