The Lambda function is not hitting the memory limit neither timing out. I read somewhere that it may return because the event loop is empty but I have context.callbackWaitsForEmptyEventLoop set to false.
Here is the function:
module.exports.callMenu = (event, context, callback) => {
context.callbackWaitsForEmptyEventLoop = false;
const eventJSON = qs.parse(event.body);
myMongooseObject.findOne({ value: eventJSON.value }, (err, theObject) => {
if (!err) {
newObj = new myMongooseObject();
newObj.message = 'this worked';
newObj.save((err) => {
if (!err) {
callback(null, { body: 'success' });
} else {
console.log(err);
}
});
}
};