1.0.2 • Published 6 years ago

@rojo2/mongoose-user v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Mongoose User plugin

Travis CI

This mongoose plugin adds four properties to the schema: username, email, password and status.

status represents the three main possible statuses of a user not-enabled, enabled and disabled.

const user = require("mongoose-user");
const {Schema} = require("mongoose");

const UserSchema = new Schema({
  type: {
    type: String,
    default: "regular",
    enum: ["premium","regular"]
  }
});

UserSchema.plugin(user);

Made with ❤ by ROJO 2 (http://rojo2.com)