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.
 

28 lines
769 B

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 },
geolocation: {
lat: {type: Number},
long: {type: Number},
name: { type: String, required: true }
}
},
user: {
type: mongoose.Schema.Types.ObjectId,
ref: 'userModel'
}
});
alertSchema.plugin(mongooseUniqueValidator);
module.exports = mongoose.model('alertModel', alertSchema);