Created
March 29, 2012 17:48
-
-
Save ovaillancourt/2240707 to your computer and use it in GitHub Desktop.
Super-transport-code-not-populating
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
var mongoose = require('mongoose') | |
,Schema = mongoose.Schema; | |
var BusStop = require('./BusStop.js'); | |
var BusScheduleSchema = require('./BusSchedule.js').schema; | |
var BusStopSchema = BusStop.schema; | |
var RouteRateSchema = require('./RouteRate.js').schema; | |
var StopEntrySchema = new Schema({ | |
order: {type: Number, min:0, required: true} | |
,stopId: {type: Schema.ObjectId, ref: 'BusStop'} | |
}); | |
var BusRouteSchema = new Schema({ | |
name: {type: String, required: true} | |
,description: String | |
,color: {type: String, uppercase: true, validate: /^\#[0-9a-fA-F]{6}$/, default: '#FFFFFF'} | |
,active: {type: Boolean, default: false} | |
,stops: [StopEntrySchema] | |
,schedules: [BusScheduleSchema] | |
,routeRates: [RouteRateSchema] | |
},{strict: true}); | |
module.exports = mongoose.model('BusRoute', BusRouteSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment