Some Code
const AWS = require('aws-sdk') const docClient = new AWS.DynamoDB.DocumentClient({ region: 'eu-central-1' }) const createDocument = (text, callback) => { const createParams = { Item: { text: text }, TableName: 'ToDoItems' } docClient.put(createParams, (err, data) => { if(err) { console.log('uh oh! ', err); } else { console.log('put some data: ', data); } }) }
Some Answers
const createParams = { TableName: "table", Key: { id: randomId }, AttributeUpdates: { authorId: {Action: "PUT", Value: event.authorId}, date: {Action: "PUT", Value: event.date}, description: {Action: "PUT", Value: event.description}, title: {Action: "PUT", Value: event.title} }, ReturnValues: "ALL_NEW" }