Mongoose User plugin
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