Skip to content

Instantly share code, notes, and snippets.

@chiehwen
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save chiehwen/8fcd3173d39d3eb11c56 to your computer and use it in GitHub Desktop.

Select an option

Save chiehwen/8fcd3173d39d3eb11c56 to your computer and use it in GitHub Desktop.
var mongoose = require('mongoose');
module.exports = mongoose.model('Flight', {
number: Number,
origin: String,
destination: String,
departs: String,
arrives: String,
actualDepart: Number,
actualArrive: Number
});
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);
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