**TL;DR:** The Node.js driver wants one MongoClient per app, created once and reused. This skill covers the Atlas SRV string, the pool options that matter, and the per-request client trap that exhausts connections. Never hardcode it, never log it. - serverSelectionTimeoutMS: 5000 turns a hung connect into a fast, debuggable error instead of a 30s stall. - maxPoolSize caps connections per client. Verify Run the startup ping from the same network your app runs on.

## The fix

1. Put the Atlas SRV string (`mongodb+srv://...`) in an env var. Never hardcode it, never log it.

2. `serverSelectionTimeoutMS: 5000` turns a hung connect into a fast, debuggable error instead of a 30s stall.

3. `maxPoolSize` caps connections per client. 10 to 50 covers most apps; one client means one pool.

4. The driver connects lazily, so an explicit `await client.connect()` plus a `ping` at startup proves the string, user, password, and IP access list entry all work before traffic arrives.

5. Close with `await client.close()` only on process shutdown, never after a request.

## When to use this

- This covers exactly what the title says: MongoDB Atlas.
- You are setting this up for the first time, or auditing an existing setup.
- You want the key gotchas in one place before you start.

## When not to use this

- You are doing a different workflow with MongoDB; these steps are specific to the title above.
- You need the full reference docs; this is the short path, not the manual.

## Compatibility

- Not pinned to a specific version; follows current MongoDB behavior.