Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (23 sloc) 609 Bytes

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