Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DynamoDB Set order

From DynamoDB docs:

An attribute of type String Set. For example:

"SS": ["Giraffe", "Hippo" ,"Zebra"]

Type: Array of strings

Required: No

This is all I could find. I did some testing but that's clearly not enough for production environments and I would like to get a confirmation/confutation from people who have actually worked with these Sets.

Do DynamoDB Sets maintain insertion order? Can I count on that fact & build logic around that?

Im mainly interested in String Set but it probably applies to all of them (String, Number, Binary).

like image 812
Solo Avatar asked Feb 05 '23 09:02

Solo


1 Answers

Here is the documentation. SET data type doesn't preserve the order.

SET : The order of the values within a set are not preserved; therefore, your applications must not rely on any particular order of elements within the set.

LIST - A list type attribute can store an ordered collection of values

Similar discussion on AWS forum

like image 138
notionquest Avatar answered Feb 28 '23 10:02

notionquest