User schema created

This commit is contained in:
Senta Mandutz 2019-05-28 14:40:14 +02:00
parent c7a835ad1c
commit 4603f7a7c1

13
user.model.js Normal file
View 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);