Skip to content

Conversation

@pulkitgarg04
Copy link
Contributor

Description

  • Update the “Using databases” section in Learn_web_development/Extensions/Server-side/Express_Nodejs/Introduction to replace the deprecated callback-based MongoDB example with a modern async/await example.
  • Use the Promise-only MongoDB Node.js driver API (v5+) with explicit connect() and close().

Motivation

  • The callback-based MongoClient.connect pattern is deprecated and removed in MongoDB Node.js driver v5+, which can confuse readers and no longer works with recent versions (e.g., [email protected], Node.js v22).
  • Using async/await reflects current best practices and ensures the sample code runs as-is.

Additional details

Related issues and pull requests

Fixes #40744

@pulkitgarg04 pulkitgarg04 requested a review from a team as a code owner September 11, 2025 12:38
@pulkitgarg04 pulkitgarg04 requested review from pepelsbey and removed request for a team September 11, 2025 12:38
@github-actions github-actions bot added Content:Learn Learning area docs size/s [PR only] 6-50 LoC changed labels Sep 11, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 11, 2025

Preview URLs

(comment last updated: 2025-09-11 23:51:11)

@Josh-Cena Josh-Cena requested review from hamishwillee and removed request for pepelsbey September 11, 2025 13:37
Copy link
Collaborator

@hamishwillee hamishwillee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Thanks very much @pulkitgarg04

@hamishwillee hamishwillee merged commit 2aa1751 into mdn:main Sep 11, 2025
8 checks passed
wbamberg added a commit to wbamberg/content that referenced this pull request Sep 15, 2025
* upstream/main: (32 commits)
  FF143 GPU import external texture experimental relnote (mdn#41126)
  added ff release note for nested pseudo-elements (mdn#41146)
  Add a page for SSRF attacks (mdn#41105)
  New CSSOM view API landing page, move CSS guides under (mdn#40547)
  40778 color input value (mdn#41086)
  Synchronize with BCD v7.1.5 (mdn#41116)
  Cross-reference `:target` and `::target-text` pages (mdn#41121)
  Fix content issues (mdn#41125)
  Make all JSON code syntactically valid (mdn#41120)
  Fix the link name with actual heading (mdn#41117)
  Associated listed form controls (mdn#41096)
  Mention `new Set()` accepts `undefined` (mdn#41106)
  chore: correct the `timeRange` function name (mdn#41107)
  Mention that custom elements constructors can't be directly called (mdn#41069)
  chore(deps): bump @mdn/fred from 1.3.2 to 1.4.0 (mdn#41111)
  Public-key cryptography glossary page: add headings and links (mdn#41092)
  Improve caret color demo contrast (mdn#41104)
  Fix supported algorithms for HKDF and PBKDF2 (mdn#41100)
  Update MongoDB example to async/await (driver v5+) (mdn#41102)
  Remove onload and DOMContentLoaded handlers (mdn#41079)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:Learn Learning area docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Outdated MongoDB Driver API

2 participants