1
0
mirror of https://github.com/Foltik/Shimapan synced 2024-11-10 23:53:31 -05:00
shimapan/app/models/User.js

29 lines
624 B
JavaScript
Raw Normal View History

2017-10-09 22:01:02 -04:00
var mongoose = require('mongoose');
2017-10-18 13:31:08 -04:00
var passportLocalMongoose = require('passport-local-mongoose');
2017-10-09 22:01:02 -04:00
var UserSchema = mongoose.Schema({
username: {
type: String,
unique: true,
required: true
},
canonicalname: {
type: String,
unique: true,
required: true
},
2017-10-18 13:31:08 -04:00
scope: [String],
2017-10-14 15:13:50 -04:00
uploadCount: {
type: Number,
default: 0
},
uploadSize: {
type: Number,
default: 0
},
2017-10-11 12:55:46 -04:00
date: Date
2017-10-09 22:01:02 -04:00
});
UserSchema.plugin(passportLocalMongoose, {usernameField: 'canonicalname'});
2017-10-09 22:01:02 -04:00
module.exports = mongoose.model('User', UserSchema);