@bouncingpixel/mongoose-db

Wrapper to set up mongoose and provides an impl for passport-auth

Stats

StarsIssuesVersionUpdatedCreatedSize
@bouncingpixel/mongoose-db
310.9.0-beta8 months ago4 years agoMinified + gzip package size for @bouncingpixel/mongoose-db in KB

Readme

mongoose-db

A mongoosedb adapter for use with Node apps at Bouncing Pixel. Implements necessary functions for use with passport-auth. Can generate a Mongo based session store if desired.

Working With

Requirements

  • NodeJS 6 LTS
  • MongoDB 3.x
  • Mongoose v4.7.x

Configuration

This module, like many other @bouncingpixel modules, relies on nconf. The following configuration keys should be defined to use this module:

Required

  • {mongoConnectStr} The connection string to the mongo database. Example: mongodb://user:pass@mydbhost:12345/mydbname.
  • {mongooseSettings} Any extra settings to pass to the initialization of mongoose. By default, autoIndex is set to true only when not in production. This setting is always set unless an explicit autoIndex is set. Generally, keeping this to false in production is ideal. As of mongoose 5, autoIndex or useMongoClient options are no longer need since the mongo client is enabled by default.

Using mongoose-db

Be sure to add mongoose to your app before using this module. The must be initialized before using. The init function will make the connection to mongo. The init function can take an optional path to the models directory and pre-load all models.

init(): Promise

getSessionStore(expressSession: ExpressSession): MongoStore

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.