diff --git a/user.model.js b/user.model.js new file mode 100644 index 0000000..54b94a5 --- /dev/null +++ b/user.model.js @@ -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);