Express session MongoDB store: connect-mongo vs connect-mongodb-session Express session MongoDB store: connect-mongo vs connect-mongodb-session mongodb mongodb

Express session MongoDB store: connect-mongo vs connect-mongodb-session


Connect-mongo has been around for much longer, while connect-mongodb-session was designed to be easier to use by being more opinionated. Connect-mongo has many more options to tweak.

The maintainers of the two libraries have a good discussion of their differences at https://github.com/mongodb-js/connect-mongodb-session/issues/15. The tl;dr is that both are stable. The only major design difference is that connect-mongodb-session does not believe that session queries should share the connection pool with other clients of the db, while connect-mongo believes they should. Both maintainers present good arguments.

Despite their apparent stability, both have surprisingly high numbers of commits. A closer look shows that most of the commits to connect-mongodb-session have just been an ongoing race to keep the dependency pointing to the latest versions of the drivers.