connect mongo - How do you retrieve all the sessions from mongodb -


my question: how retrieve sessions mongodb given no model defined sessions documents?

thus can't sessions.find({}).exec() because sessions doesn't exist.

i'm using passport, express, connect-mongo, mongoose

app.use(session({   resave: true,   saveuninitialized: true,   secret: process.env.session_secret,   store: new mongostore({     url: process.env.mongodb || process.env.mongolab_uri,         collection: 'sessions',     autoreconnect: true,     ttl: (24 * 60 * 60),// 1 day default before expires   }),   cookie: {       path: '/',       httponly: true,       maxage: (60000 * 60 * 24),       secure: 'auto',//secure cookies true when in production on https   } })); 

i'm wanting retrieve sessions not current session. solution far access database directly.

i have tried using req.session retrieves current session.


Comments

Popular posts from this blog

javascript - Replicate keyboard event with html button -

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Web audio api 5.1 surround example not working in firefox -