Mongoose 6.11.4 on lambda #13852
Unanswered
john-montgomery2003
asked this question in
Q&A
Replies: 1 comment
-
Have you actually connected to MongoDB? Try printing out |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have an nextjs server running on a lambda, which is running payloadcms. I have identified that it seems like mongoose is returning the lambda somehow on a Model.FindOne(). Heres the snippet im running, which is an adjustment of - https://github.com/payloadcms/payload/blob/master/src/auth/operations/login.ts#L84 where i see the issue.
I am connecting to a mongodb atlas serverless cluster, although, as payload handles the actual connection, i dont have the initialisation options being selected, however, we have observed its ability to connect and write to the database. Perhaps the connection is being held mistakenly by the lambda as it seems its opened on startup?
Atlas is configured to allow all IPs and is authorising through username and password (aware this is a risk, wont be done in prod)
The behaviour we are seeing is 'Fetching from mongoose' is outputting, as expected, followed by the lambda terminating. There is no error message caught from here. I have checked memory usage, the lambda as 2gb assigned, uses little over 300mb, doesnt seem to be a leak anywhere.
Any ideas are appreciated!
Beta Was this translation helpful? Give feedback.
All reactions