我是AWS的新手..使用“ EmailId”作为键创建了Basic DynamoDB表,并将记录添加到了“ PlayerDetials”表中。以下是我的Lambda函数。当我测试它时,它总是返回Null而不是一条记录。
const AWS = require('aws-sdk');
var docClient = new AWS.DynamoDB.DocumentClient({
'region': 'us-east-1'
});
var tableName = "PlayerDetails";
exports.handler = (event, context, callback) => {
var params = {
TableName : tableName,
Key: {
"EmailId" : event.EmailId
}
}
docClient.get(params, function(err,data){
callback(null, data);
})
};