When adding an array at DynamoDB with put_item, is there any way to tell it to preserve the order of the values of the array?
Example: I’m adding array(“2”, “1”, “4”), and it’s added to the table as 1, 2, 4. I don’t want dynamo to mess up with my array 🙂
Thanks in advance.
No, as arrays in dynamoDB are Sets, they don’t preserve any ordering.
best alternative for you is to concatenate them into a string (using a delimiter) and then inserting this string i.e. 2#1#4 and then split them when you read back.