My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Unmarshalling DynamoDB record

Pedro Alvarado's photo
Pedro Alvarado
·Sep 23, 2019
const aws = require('aws-sdk');
const converter = aws.DynamoDB.Converter;

ddbjson = {
    "body": {
        "M": {
            "EventSource": {
                "S": "aws:sns"
            }
        }
    }
}
console.log(JSON.stringify(converter.unmarshall(ddbjson)));

output:

{"body":{"EventSource":"aws:sns"}}