generator-modern-node
Version:
The Modern Express Generator
32 lines (26 loc) • 414 B
JavaScript
;
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
// Create Schema
const UserSchema = new Schema({
username: {
type: String,
},
password: {
type: String,
},
changeLog: {
type: Object,
default: {
log: [
],
},
}}, {
toObject: {
virtuals: true,
},
toJSON: {
virtuals: true,
},
});
mongoose.model('users', UserSchema);