I attempted to marshal
a String Set from DynamoDB and then unmarshal
it back as shown 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":{}}
});
However, I am struggling to retrieve the String Set properly. What is the correct method for retrieving a String Set from DynamoDB and utilizing it?