serverless / serverless/examples

aws-node-mongodb-atlas code outdated

Open
#793 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
11.5k
Forks
4.4k
Avg merge
2h 55m
Merged PRs (30d)
3

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with handler.js and serverless.yml, checking the mongodb 6.8.0 connection behavior, the MongoDB Atlas URL, and the configured Node.js runtime. Update the outdated settings and verify that the example no longer calls the removed connection method, uses a current Atlas URL, and targets a supported runtime.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript, mongodb, node.js
Domain
backend, cloud, database
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.