Created
February 8, 2017 19:45
-
-
Save donedgardo/f1dd13c9f7882e0a9ed15c6c9c242f49 to your computer and use it in GitHub Desktop.
ES6 Article
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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