Browse Source

moved db-model-schemata, adjust user-model

master
Erik Römmelt 4 years ago
parent
commit
37e7d757c3
4 changed files with 21 additions and 14 deletions
  1. 0
    0
      database/message.model.js
  2. 0
    0
      database/tag.model.js
  3. 21
    0
      database/user.model.js
  4. 0
    14
      user.model.js

message.model.js → database/message.model.js View File


tag.model.js → database/tag.model.js View File


+ 21
- 0
database/user.model.js View File

@@ -0,0 +1,21 @@
const mongoose = require('mongoose');


const UserSchema = mongoose.Schema({
// _id: { type: String },
name: { type: String, required: true },
pwd: { type: String },
// hash: { type: String },
// salt: { type: String },
// type: { type: String },
roles: { type: [String], required: true },
tags: { type: [String] },
// deactivated: { type: Boolean },
// participating: { type: [String] },
// host: { type: Boolean },
bookmarks: { type: [String] },
});
//tags as index:
//UserSchema.index({tags:'text'});

module.exports = mongoose.model('User', UserSchema);

+ 0
- 14
user.model.js View File

@@ -1,14 +0,0 @@
const mongoose = require('mongoose');


const UserSchema = mongoose.Schema({
name: { type: String, required: true },
password: {type: String}, 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