Search code examples
amazon-web-serviceslambdaamazon-dynamodbamazon-dynamodb-streams

What are the extra values added to DynamoDB streams and how do I remove them?


I am using DynamoDB streams to sync data to Elasticsearch using Lambda

The format of the data (from https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.Lambda.Tutorial.html) looks like:

"NewImage": {
                "Timestamp": {
                    "S": "2016-11-18:12:09:36"
                },
                "Message": {
                    "S": "This is a bark from the Woofer social network"
                },
                "Username": {
                    "S": "John Doe"
                }
            },

So two questions.

  1. What is the "S" that the stream attaches. I am assuming it is to indicate string or stream, but I can't find any documentation.

  2. Is there an option to exclude this from the stream or do I have to write code in my lambda function to remove it?


Solution

  • What you are seeing is the DynamoDB Data Type Descriptors. This is how data is stored in DynamoDB (or at least how it is exposed via the low level APIs). There are SDKs is various languages that will convert this to JSON.