-
Notifications
You must be signed in to change notification settings - Fork 23k
Closed
Labels
Content:Learn:ExpressLearning area Express docsLearning area Express docs
Description
MDN URL
What specific section or headline is this issue about?
using_databases
What information was incorrect, unhelpful, or incomplete?
const { MongoClient } = require("mongodb");
MongoClient.connect("mongodb://localhost:27017/animals", (err, client) => {
if (err) throw err;
const db = client.db("animals");
db.collection("mammals")
.find()
.toArray((err, result) => {
if (err) throw err;
console.log(result);
client.close();
});
});What did you expect to see?
The callback-based MongoClient.connect method is deprecated in newer versions of the MongoDB, So I expected code which uses the modern API (Async/Await)
Do you have any supporting links, references, or citations?
No response
Do you have anything more you want to share?
No response
MDN metadata
Page report details
- Folder:
en-us/learn_web_development/extensions/server-side/express_nodejs/introduction - MDN URL: https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Server-side/Express_Nodejs/Introduction
- GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/learn_web_development/extensions/server-side/express_nodejs/introduction/index.md
- Last commit: 8443cb3
- Document last modified: 2025-07-18T00:38:58.000Z
Metadata
Metadata
Assignees
Labels
Content:Learn:ExpressLearning area Express docsLearning area Express docs