title: Lambda + Nodejs + dynamodb : storing json : Why put item storing data types?
body: <p>I'm trying to store the json object in dynamodb using the code given below.  </p>
  
  <pre class="lang-js prettyprint-override"><code>exports.handler = function (event, context, callback) {
  
      var docClient = new AWS.DynamoDB.DocumentClient();
  
      var table = "Logs";
  
      id_val = 1
      var params = {
          TableName: table,
          Item: {
              "id": id_val,
              "message": event
          }
      };
  
      docClient.put(params, function(err, data) {
          if (err) {
              callback(null, JSON.stringify(err, null, 2));
              context.fail("Unable to add item. Error JSON:", JSON.stringify(err, null, 2));
          }
      });
  }
  </code></pre>
  
  <p>Input to event</p>
  
  <pre><code>[
      {
          "id": 1,
          "demographic": {
              "firstName": "John",
              "middleName": "w",
              "lastName": "Doe",
              "suffix": "jr",
              "birthDate": "1990-02-02",
              "gender": "M",
              "ssn": 123
          }
      }
  ]
  </code></pre>
  
  <p>What's stored in the table</p>
  
  <pre><code>{
      "id": {
          "N": "84.20420287568176"
      },
      "message": {
          "L": [
              {
                  "M": {
                      "demographic": {
                          "M": {
                              "birthDate": {
                                  "S": "1990-02-02"    
         ...
         ...
         ...
  </code></pre>
  
  <p>Why is datatype being stored in the table? How can one break this down so that attributes are stored separately?</p>