connect-mongo

JSON →
library 6.0.0 ·javascript
verified Jun 5, 2026

MongoDB session store for Express and Connect written in TypeScript. Current stable version is 6.0.0, released with breaking changes from v4 rewritten in TypeScript. Supports Express 4.x/5.0, Connect 3.x, and MongoDB Node driver 5.x-7.x, with CI testing across Node 20, 22, and 24. Key differentiator is seamless integration with express-session providing MongoDB-backed session persistence, lazy session updates, transparent encryption, and configurable auto-removal of expired sessions. Requires express-session and mongodb as peer dependencies.