I am playing with AWS Lambda using Node.js. After being tired of having to deal with callbacks I figured I could elegantly use async/await just like I am used to in C#.
exports.handler = async(event, context, callback) => {
db = await MongoClient.connect(process.env['MONGODB_URI']);
}
Even though this seemingly works when testing offline using lambda-local, it fails miserably when uploaded to AWS. It appears as if async keyword is not recognized. I am using the latest Node.js 6.10 runtime on AWS while my local version is 8.5. Is there a way around or should I abandon this approach and go back to using callbacks?