#793·examples

aws-node-mongodb-atlas code outdated

Author: docwaremsCreated Aug 6, 2024Updated Jun 21, 2025

handler.js uses client.isConnected(); this results in runtime error I upgraded to current "mongodb" npm 6.8.0 According to research client.connect() is a no-op if already connected, so I just removed the client.isConnected() condition.

Also the MongoDB Atlas URL seems to be wrong today - at least it doesn't match mine. I just replaced it.

Last but not least, serverless.yml sets nodejs14x runtime, which is no longer supported.

I'm going to provide a PR with these minor fixes.