Skip to content

Instantly share code, notes, and snippets.

@james-gardner
Last active May 25, 2016 12:52
Show Gist options
  • Save james-gardner/5b2e6fd414fe696f7c36 to your computer and use it in GitHub Desktop.
Save james-gardner/5b2e6fd414fe696f7c36 to your computer and use it in GitHub Desktop.
Mongoose Schemas for Resume
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
var PositionSchema = new Schema({
company : String,
position : String,
summary : String,
startDate : Date
});
module.exports = mongoose.model('position', PositionSchema);
var mongoose = require('mongoose'),
position = require('./position'),
Schema = mongoose.Schema;
var ResumeSchema = new Schema({
name : String,
email : String,
phone : String,
positions : [{ type: Schema.ObjectId, ref : 'position'}]
});
module.exports = mongoose.model('resume', ResumeSchema);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment