arnaucube
arnaucube/commonroutesServerPublic Self-hosted repository
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})
19
20notificationSchema.plugin(mongooseUniqueValidator);
21module.exports = mongoose.model('notificationModel', notificationSchema);