commonroutesServer/models/notificationModel.js
models/notificationModel.jsRaw
1var mongoose = require('mongoose'),
2 Schema = mongoose.Schema;
3
4var mongooseUniqueValidator = require('mongoose-unique-validator');
5
6
7var notificationSchema = new Schema({
8 user: {
9 type: mongoose.Schema.Types.ObjectId,
10 ref: 'userModel'
11 },
12 state: {type: String, default: "pendent"},//viewed, pendent
13 concept: {type: String},
14 message: {type: String},
15 link: {type: String},//aquí oju, a la app i a la web calen links diferents
16 date: {type: Date},
17 dateviewed: {type: Date},
18 icon: {type: String}
19})
20
21notificationSchema.plugin(mongooseUniqueValidator);
22module.exports = mongoose.model('notificationModel', notificationSchema);