Refactor utils and organize routes/schema
This commit is contained in:
25
schema/user.model.js
Normal file
25
schema/user.model.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const mongoose = require('mongoose');
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
// Database schema for a user
|
||||
let User = new Schema({
|
||||
email: {
|
||||
type: String
|
||||
},
|
||||
name: {
|
||||
type: String
|
||||
},
|
||||
password: {
|
||||
type: String
|
||||
},
|
||||
permission: {
|
||||
type: Number
|
||||
},
|
||||
favorites: {
|
||||
type: Array
|
||||
}
|
||||
}, {
|
||||
collection: 'users'
|
||||
});
|
||||
|
||||
module.exports = mongoose.model('User', User);
|
||||
Reference in New Issue
Block a user