MongoDB Atlas with Node.js — 47/55 in the Node.js series. Full playlist companion: Node.js complete course on YouTube. Prefer one article? Read the complete Node.js tutorial.
Short description
MongoDB Atlas provides managed cloud clusters. Create a cluster, whitelist IPs, create a DB user, then use the connection string in `.env`.
Connect with Mongoose
await mongoose.connect(process.env.MONGO_URL);
console.log('Connected to Atlas');