I have tried to marshall DynamoDB's String Set and unmarshall it back as below.
import {marshall, unmarshall} from '@aws-sdk/util-dynamodb';
test('Marshall and Unmarshall Test', () => {
const raw = {
'anArray': new Set([
'Apple',
'Mango'
])
};
console.log(JSON.stringify(marshall(raw)));
// {"anArray":{"SS":["Apple","Mango"]}}
const marshalledResult = marshall(raw);
console.log(JSON.stringify(unmarshall(marshalledResult)));
// {"anArray":{}}
});
But I am not able to get the String Set back. How should we be doing this when we should get a String Set from dynamo db and use it?