User schema created
This commit is contained in:
parent
c7a835ad1c
commit
4603f7a7c1
13
user.model.js
Normal file
13
user.model.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
const mongoose = require('mongoose');
|
||||||
|
|
||||||
|
|
||||||
|
const UserSchema = mongoose.Schema({
|
||||||
|
name: { type: String, required: true },
|
||||||
|
password: {type: String},
|
||||||
|
role: {type: String, required: true},
|
||||||
|
tags: [{type: String }],
|
||||||
|
});
|
||||||
|
//tags as index:
|
||||||
|
//UserSchema.index({tags:'text'});
|
||||||
|
|
||||||
|
module.exports = mongoose.model('User', UserSchema);
|
Loading…
x
Reference in New Issue
Block a user