DynamoDB putitem in NodeJs - arrays of objects

You could convert the object to DynamoDb record first

const AWS = require('aws-sdk');
var tableName = "GDCCompetition";
var datetime = new Date().getTime().toString();
const members = [
  {
    "email": "[email protected]",
    "name": "Bob"
  },
  {
    "email": "[email protected]",
    "name": "Alice"
  }
];
const marshalled = AWS.DynamoDB.Converter.marshall({ members });
const params = {
  "TableName": tableName,
  "Item": {
    "datetime": {
      "N": datetime
    },
    "teamName": {
      "S": event.teamName
    },
    "members": marshalled.members,
  },
}
AWS.DynamoDB.putItem(params, function (err) {
  if (err) {
    return throw err;
  }
});

The documentation is not really obvious, but there is a thing called DocClient, you can pass a usual JS object to it and it will do all the parsing and transformation into AWS object (with all the types). You can use it like this:

var AWS = require("aws-sdk");
var DynamoDB = new AWS.DynamoDB.DocumentClient();

var params = {
    TableName: "MyTable",
    Item: {
        "teamName": "Team Awesome",
        "members": [
            {
                "email": "[email protected]",
                "name": "Bob"
            },
            {
                "email": "[email protected]",
                "name": "Alice"
            }
         ]
    } 
};

DynamoDB.put(params, function (err) {
     if (err) {
         return throw err;
     }

     //this is put
});