Right syntax for multiple input event params in AWS Lambda NodeJS

女生的网名这么多〃 提交于 2020-08-10 19:35:13

问题


Can anyone help me correct with this code in Lambda Nodejs with multiple input event params.

I've tried already the following but no luck!

ABC = ? WHERE XYZ = ?;', event['ABC', 'XYZ'], function (error, results, fields)

ABC = ? WHERE XYZ = ?;', event['ABC']['XYZ'], function (error, results, fields)

ABC = ? WHERE XYZ = ?;', event['ABC'], event['XYZ'], function (error, results, fields)

回答1:


The correct syntax that you should be using is below.

By doing this you're providing them as a list.

event['ABC', 'XYZ'] is not valid syntax.

event['ABC']['XYZ'] is looking for a XYZ key inside of event['ABC'].

event['ABC'], event['XYZ'] is passing in to many parameters.

ABC = ? WHERE XYZ = ?;', [event['ABC'], event['XYZ']], function (error, results, fields)


来源:https://stackoverflow.com/questions/63030217/right-syntax-for-multiple-input-event-params-in-aws-lambda-nodejs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!