From 4603f7a7c1e28063b65ad4489a75c12ea8da2e8e Mon Sep 17 00:00:00 2001 From: senta_mandutz Date: Tue, 28 May 2019 14:40:14 +0200 Subject: [PATCH] User schema created --- user.model.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 user.model.js 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);