【发布时间】:2018-03-08 16:26:46
【问题描述】:
我想从 DynamoDb 发送更改的数据触发 lambda 函数。然后我想将这些更改的数据保存在不同的 DynamoDb 表中。
编程语言: NodeJs
DynomaDb
流启用:是
查看类型:新旧图片
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 '使用严格'; console.log('加载函数'); export.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); });回调(空,
Successfully processed ${event.Records.length} records.); }; -
但这是抛出错误@VijayanathViswanathan
-
请更新您有问题的代码,以便对社区中的所有其他人有所帮助。谢谢:)
-
谢谢@VijayanathViswanathan :)
标签: amazon-web-services lambda amazon-dynamodb