Skip to content

Instantly share code, notes, and snippets.

@donedgardo
Created February 8, 2017 19:45
Show Gist options
  • Save donedgardo/f1dd13c9f7882e0a9ed15c6c9c242f49 to your computer and use it in GitHub Desktop.
Save donedgardo/f1dd13c9f7882e0a9ed15c6c9c242f49 to your computer and use it in GitHub Desktop.
ES6 Article
import mongoose, { Schema } from 'mongoose';
export const FoodTruckSchema = new Schema({
image: {
type: String,
},
logo: {
type: String,
},
name: {
type: String,
required: true,
},
takingOrders: {
type: Boolean,
default: true,
},
available: {
type: Boolean,
default: true,
},
location: {
type: [Number],
index: '2d',
},
category: [{
type: Schema.Types.ObjectId,
ref: 'Categories',
default: [],
}],
rating: {
type: Number,
min: 0,
max: 5,
default: null,
},
features: [{
type: String,
max: 16,
default: []
}],
owner: {
type: Schema.Types.ObjectId,
ref: 'Users',
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment