Skip to content

ramv/connect-mongodb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Connect MongoDB

connect-mongodb is a MongoDB session store backed by node-mongodb-native.

Originally written by dvv

Installation

Via git:

$ git clone git://github.com/masylum/connect-mongodb.git ~/.node_libraries/connect-mongodb

via npm:

$ npm install connect-mongodb

Options

  • dbname MongoDB db name
  • host MongoDB server hostname
  • port MongoDB server portno
  • collection MongoDB collection to host sessions. 'sessions' by default.

Example

var connect = require('connect')
      , mongoStore = require('connect-mongodb');

connect.createServer(
  connect.bodyDecoder(), // Always before the session
  connect.cookieDecoder(),
  connect.session({ store: mongoStore() })
);

Warning

If you use the bodyDecoder middleware, place it before the session one!

About

SessionStorage for connect's session middleware

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published