问题
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