Browse Source

User schema created

master
Senta Mandutz 5 years ago
parent
commit
4603f7a7c1
1 changed files with 13 additions and 0 deletions
  1. 13
    0
      user.model.js

+ 13
- 0
user.model.js View File

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…
Cancel
Save