How to use mongoose-geojson-schema - 6 common examples

To help you get started, we’ve selected a few mongoose-geojson-schema examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mgenev / nautilus / server / models / vendor.js View on Github external
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;
github mgenev / nautilus / server / models / status.js View on Github external
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;
github mgenev / nautilus / server / models / event.js View on Github external
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;
github mgenev / nautilus / server / models / photo.js View on Github external
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;
github mgenev / nautilus / server / models / trip.js View on Github external
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;
github mgenev / nautilus / server / models / album.js View on Github external
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;

mongoose-geojson-schema

Schema definitions for GeoJSON types for use with Mongoose JS

MIT
Latest version published 1 year ago

Package Health Score

55 / 100
Full package analysis

Popular mongoose-geojson-schema functions