this is my lambda function
var AWS = require("aws-sdk");
var dynamodb = new AWS.DynamoDB();
var docClient = new AWS.DynamoDB.DocumentClient();
exports.handler = (event, context, callback) => {
var params = {
TableName: 'xx',
Key: {
project_id : event.id,
name: event.name
}
};
docClient.delete(params, function(err, data) {
if (err) {
console.error("Unable to read item. Error JSON:", JSON.stringify(err, null, 2));
} else {
callback(null, data);
}}
);
};
my test event is
{
"id": "1490022172442",
"name":"xcv"
}
And still i got error "The provided key element does not match the schema". POST and GET is working nice but I am stucked here.