AWS Lambda showing previous output with current output

Viewed 125

So as I have described, my AWS Lambda function is showing the output for my previous input, along with my present input's output. My lambda function takes IT keywords as JSONArray input and fetches certain records from the mySQL table where the keyword exists in the column. For eg.

I run the function with this input :-

input: { "keywords": ["Python"] } output: { "records": [{"record 1": "Python 1", "record 2": "Python 2"}] }

But when I run the same function on another keyword, say, HTML :-

input: { "keywords": ["HTML"] } output: { "records": [{"record 1": "HTML 1", "record 2": "HTML 2"}, {"record 1": "Python 1", "record 2": "Python 2"}] }

The current output retains the previous output. I have checked my code, and it runs properly on Eclipse. Is there a configuration issue with the AWS Lambda where it retains previous input?

1 Answers
Related