Querying DynamoDB with Lambda does nothing

前端 未结 6 829
北恋
北恋 2021-02-07 09:01

I have the following code for a Lambda function:

console.log(\'Loading function\');
var aws = require(\'aws-sdk\');
var ddb = new aws.DynamoDB();

function getUs         


        
6条回答
  •  孤独总比滥情好
    2021-02-07 09:30

    Now since node.js has introduced async/await, this can make it wait until the query call returns before the main function terminates:

    let result = await ddb.getItem(params).promise();
    return result;
    

提交回复
热议问题