我想要发送已更改的数据从DynamoDb触发了lambda函数。然后,我想要保存这个已更改的数据不同的DynamoDb表。
编程语言:的NodeJS
DynomaDb
流启用:是
查看方式:新的和旧的图像如何发送数据触发lambda函数?
lambda函数
'use strict';
console.log('Loading function');
exports.handler = (event, context, callback) => {
//console.log('Received event:', JSON.stringify(event, null, 2));
event.Records.forEach((record) => {
console.log(record.eventID);
console.log(record.eventName);
console.log('DynamoDB Record: %j', record.dynamodb);
});
callback(null, `Successfully processed ${event.Records.length} records.`);
};
它不工作。
你有什么到目前为止已经试过删除? –
@VijayanathViswanathan 'use strict'; console.log('加载函数'); exports.handler =(event,context,callback)=> { //console.log('Received event:',JSON.stringify(event,null,2)); (记录)=> { console.log(record.eventID); console.log(record.eventName); console.log('DynamoDB Record:%j',record.dynamodb) ; }); callback(null,'成功处理$ {event.Records.length} records.'); }; –
但它是抛出错误@VijayanathViswanathan –