A MongoDB session store for Express and Connect applications, written in TypeScript.
Connect-mongo is a MongoDB-based session store for Express and Connect web frameworks. It allows Node.js applications to persist session data in MongoDB, providing features like automatic expiration cleanup, encryption, and lazy updates to optimize performance and security.
Node.js developers building Express or Connect applications who need a reliable, scalable session storage solution using MongoDB.
Developers choose connect-mongo for its robust MongoDB integration, TypeScript support, and advanced features like transparent encryption and configurable session cleanup, making it a trusted choice for production applications.
MongoDB session store for Express
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers multiple strategies for removing expired sessions, including native MongoDB TTL indexes and interval-based cleanup, reducing manual maintenance.
Provides transparent encryption using Web Crypto API or legacy adapters, aligning with OWASP security recommendations for sensitive session data.
Features lazy session updates via the touchAfter option to minimize database writes, improving scalability under high load.
Written in TypeScript with full type definitions and supports flexible connection options, including reusing existing MongoClient instances.
Version 4 introduced significant breaking changes from v3, requiring migration efforts and causing encryption compatibility issues with older sessions.
Ties session storage exclusively to MongoDB, limiting portability if switching databases or using multi-database architectures.
Multiple options for autoRemove, crypto adapters, and connection strategies can overwhelm developers seeking simple drop-in solutions.