Some generic methods, statics and virtuals used for user schemas
Switch branches/tags
Nothing to show
Pull request Compare This branch is 3 commits behind madhums:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
History.md
Makefile
README.md
index.js
package.json

README.md

mongoose-user

Some generic methods, statics and virtuals used for user schemas

Installation

$ npm install mongoose-user

or include it in package.json

Usage

var mongoose = require('mongoose')
var userPlugin = require('mongoose-user')

var UserSchema = new mongoose.Schema({
  name: { type: String, default: '' },
  email: { type: String, default: '' },
  username: { type: String, default: '' },
  hashed_password: { type: String, default: '' },
  salt: { type: String, default: '' }
})

UserSchema.plugin(userPlugin, {})

mongoose.model('User', UserSchema)

License

MIT