Models
parent
0220fc745a
commit
5282b3c4fa
|
@ -1,11 +1,25 @@
|
|||
var mongoose = require('mongoose');
|
||||
var Schema = mongoose.Schema;
|
||||
var bcrypt = require('bcrypt-nodejs');
|
||||
|
||||
var UserSchema = new Schema({
|
||||
firstname: String,
|
||||
lastname: String,
|
||||
username: String,
|
||||
password: String
|
||||
firstname: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
lastname: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
username: {
|
||||
type: String,
|
||||
unique: true,
|
||||
required: true
|
||||
},
|
||||
password: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = mongoose.model('User', UserSchema);
|
||||
|
|
Loading…
Reference in New Issue