mirror of
https://github.com/arnaucube/openEventsPlatformServer.git
synced 2026-02-07 11:46:38 +01:00
userModel, eventModel, alertModel --> done; signup,login,getAllUsers,getUserById --> done
This commit is contained in:
31
models/eventModel.js
Normal file
31
models/eventModel.js
Normal file
@@ -0,0 +1,31 @@
|
||||
var mongoose = require('mongoose'),
|
||||
Schema = mongoose.Schema;
|
||||
|
||||
var mongooseUniqueValidator = require('mongoose-unique-validator');
|
||||
|
||||
var eventSchema = new Schema({
|
||||
title: { type: String },
|
||||
description: { type: String },
|
||||
img: { type: String },
|
||||
date: { type: Date },
|
||||
categories: [{
|
||||
name: {type: String}
|
||||
}],
|
||||
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'
|
||||
}
|
||||
});
|
||||
|
||||
eventSchema.plugin(mongooseUniqueValidator);
|
||||
module.exports = mongoose.model('eventModel', eventSchema);
|
||||
Reference in New Issue
Block a user