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
828 B

  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. message: {type: String},
  11. link: {type: String},//aquí oju, a la app i a la web calen links diferents, però ho podem fer posant sempre a la app i a la web el prefix del link (#!/app) o (#/app/), i després afegint-hi la pàgina on volem enviar el routing, per exemple (dashboard)
  12. icon: {type: String},
  13. date: {type: Date},
  14. dateviewed: {type: Date}
  15. })
  16. notificationSchema.plugin(mongooseUniqueValidator);
  17. module.exports = mongoose.model('notificationModel', notificationSchema);