Last active
August 29, 2015 14:05
-
-
Save chiehwen/8fcd3173d39d3eb11c56 to your computer and use it in GitHub Desktop.
This file contains hidden or 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'); | |
| module.exports = mongoose.model('Flight', { | |
| number: Number, | |
| origin: String, | |
| destination: String, | |
| departs: String, | |
| arrives: String, | |
| actualDepart: Number, | |
| actualArrive: Number | |
| }); |
This file contains hidden or 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 FlightSchema = new Schema({ | |
| number: Number, | |
| origin: String, | |
| destination: String, | |
| departs: String, | |
| arrives: String, | |
| actualDepart: Number, | |
| actualArrive: Number | |
| }); | |
| // Compile a 'Flight' model using the FlightSchema as the structure. | |
| // Mongoose also creates a Mongo collection called 'Flight' for these documents. | |
| var Flight = mongoose.model('Flight', FlightSchema); |
This file contains hidden or 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 FlightSchema = new Schema({ | |
| number: Number, | |
| origin: String, | |
| destination: String, | |
| departs: String, | |
| arrives: String, | |
| actualDepart: Number, | |
| actualArrive: Number | |
| }); | |
| module.exports = mongoose.model('Flight', FlightSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment