mongodb-js/connect-mongodb-session

How to use an existing mongoose connection

nickgarver opened this issue · 1 comments

How could I connect to mongo using an existing mongoose connection, similar to this example in connect-mongo.

const mongoose = require('mongoose');

// Basic usage
mongoose.connect(connectionOptions);

app.use(session({
    store: new MongoStore({ mongooseConnection: mongoose.connection })
}));

That functionality is intentionally omitted from this module, we only support passing in a connection string so this module can create its own connection to avoid slow trains