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
asked a month ago102 views
1 Answer
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
EXPERT
answered a month ago
  • Thank you for the clarity

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions