You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
652 B

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