Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import {Schema} from 'mongoose';
import autopopulate from 'mongoose-autopopulate';
import GeoJSON from 'mongoose-geojson-schema';
import {SimpleTimestamps} from 'mongoose-SimpleTimestamps';
let vendor = new Schema({
user: {
type: Schema.ObjectId,
ref: 'user',
autopopulate: true
},
name: String,
location: GeoJSON.Point,
description: String,
address: String,
urlSegment: String,
category: String,
logo: String,
photos: [{
type: Schema.ObjectId,
ref: 'photo',
autopopulate: true
}],
});
vendor.plugin(SimpleTimestamps);
vendor.plugin(autopopulate);
module.exports = vendor;
import {Schema} from 'mongoose';
import autopopulate from 'mongoose-autopopulate';
import GeoJSON from 'mongoose-geojson-schema';
import {SimpleTimestamps} from 'mongoose-SimpleTimestamps';
let status = new Schema({
user: {
type: Schema.ObjectId,
ref: 'user',
autopopulate: true
},
note:String,
state:String,
activity: String,
location: GeoJSON.Point,
address:String
});
status.plugin(SimpleTimestamps);
status.plugin(autopopulate);
module.exports = status;
import autopopulate from 'mongoose-autopopulate';
import GeoJSON from 'mongoose-geojson-schema';
import {SimpleTimestamps} from 'mongoose-SimpleTimestamps';
let event = new Schema({
organizer: {
type: Schema.ObjectId,
ref: 'user',
autopopulate: true
},
guests: [{
type: Schema.ObjectId,
ref: 'user',
autopopulate: true
}],
location: GeoJSON.Point,
address:String,
title: String,
description: String,
eventDate: Date
});
event.plugin(SimpleTimestamps);
event.plugin(autopopulate);
module.exports = event;
import {Schema} from 'mongoose';
import autopopulate from 'mongoose-autopopulate';
import GeoJSON from 'mongoose-geojson-schema';
import {SimpleTimestamps} from 'mongoose-SimpleTimestamps';
let photo = new Schema({
user: {
type: Schema.ObjectId,
ref: 'user',
autopopulate: true
},
album: {
type: Schema.ObjectId,
ref: 'album'
},
location: GeoJSON.Point,
address:String,
name: String,
filePath: String,
thumbPath: String,
description:String,
tags : [String]
});
photo.plugin(SimpleTimestamps);
photo.plugin(autopopulate);
module.exports = photo;
import {Schema} from 'mongoose';
import autopopulate from 'mongoose-autopopulate';
import GeoJSON from 'mongoose-geojson-schema';
import {SimpleTimestamps} from 'mongoose-SimpleTimestamps';
let trip = new Schema({
user: {
type: Schema.ObjectId,
ref: 'user',
autopopulate: true
},
name:String,
description:String,
startDate: Date,
endDate: Date,
locations: [GeoJSON.Point],
tags: [String],
photos: [{ type: Schema.Types.ObjectId, ref: 'photo' }]
});
trip.plugin(SimpleTimestamps);
trip.plugin(autopopulate);
module.exports = trip;
import {Schema} from 'mongoose';
import autopopulate from 'mongoose-autopopulate';
import GeoJSON from 'mongoose-geojson-schema';
import {SimpleTimestamps} from 'mongoose-SimpleTimestamps';
let album = new Schema({
user: {
type: Schema.ObjectId,
ref: 'user',
autopopulate: true
},
location: GeoJSON.Point,
address:String,
name: String,
description:String,
tags : [String]
});
album.plugin(SimpleTimestamps);
album.plugin(autopopulate);
module.exports = album;