Last active
August 29, 2015 14:13
-
-
Save DouglasHennrich/56e31364c0d7ad5fd069 to your computer and use it in GitHub Desktop.
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'); | |
var Schema = mongoose.Schema: | |
var MotoboySchema = new Schema({ | |
name : { type : String, default : '', required : true } | |
, cidade : { type : String, default : '', required : true } | |
, created_at : { type : Date, default : Date.now } | |
}); | |
module.exports = mongoose.model( 'Motoboy', MotoboySchema ); |
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'); | |
var Schema = mongoose.Schema: | |
var PacoteSchema = new Schema({ | |
endInicial : { type : Object, default : '', required : true } | |
, endFinal : { type : Object, default : '', required : true } | |
, idCliente : { type : Schema.Types.ObjectId, ref: 'Clientes', default : '', required : true } | |
, idPacote : { type : String, default : '', required : true } | |
}); | |
module.exports = mongoose.model( 'Pacote', PacoteSchema ); |
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'); | |
var Schema = mongoose.Schema: | |
var PosicaoSchema = new Schema({ | |
lat : { type : Number, default : '', required : true } | |
, lng : { type : Number, default : '', required : true } | |
, idMotoboy : { type : Schema.Types.ObjectId, ref: 'Motoboys', default : '', required : true } | |
, idPacote : { type : Schema.Types.ObjectId, ref: 'Pacotes', default : '', required : true } | |
}); | |
module.exports = mongoose.model( 'Posicoe', PosicaoSchema ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment