alert system implemented

This commit is contained in:
arnaucode
2017-02-21 09:44:42 +01:00
parent 339dd3e26c
commit 509f061016
4 changed files with 54 additions and 30 deletions

View File

@@ -1,28 +0,0 @@
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
var mongooseUniqueValidator = require('mongoose-unique-validator');
var alertSchema = new Schema({
title: { type: String },
description: { type: String },
img: { type: String },
date: { type: Date },
location:{
direction: { type: String },
city: { type: String },
district: { type: String },
geo: {
lat: {type: Number},
long: {type: Number},
name: { type: String }
}
},
user: {
type: mongoose.Schema.Types.ObjectId,
ref: 'userModel'
}
});
alertSchema.plugin(mongooseUniqueValidator);
module.exports = mongoose.model('alertModel', alertSchema);

View File

@@ -25,7 +25,8 @@ var eventSchema = new Schema({
user: {
type: mongoose.Schema.Types.ObjectId,
ref: 'userModel'
}
},
type: {type: String}
});
eventSchema.plugin(mongooseUniqueValidator);