2019-05-28 14:40:14 +02:00
|
|
|
const mongoose = require('mongoose');
|
|
|
|
|
|
|
|
|
|
|
|
const UserSchema = mongoose.Schema({
|
|
|
|
name: { type: String, required: true },
|
2019-06-04 15:26:38 +02:00
|
|
|
password: {type: String}, password: {type: String},
|
|
|
|
|
2019-05-28 14:40:14 +02:00
|
|
|
role: {type: String, required: true},
|
|
|
|
tags: [{type: String }],
|
|
|
|
});
|
|
|
|
//tags as index:
|
|
|
|
//UserSchema.index({tags:'text'});
|
|
|
|
|
|
|
|
module.exports = mongoose.model('User', UserSchema);
|