Last active
May 25, 2016 12:52
-
-
Save james-gardner/5b2e6fd414fe696f7c36 to your computer and use it in GitHub Desktop.
Mongoose Schemas for Resume
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'), | |
Schema = mongoose.Schema; | |
var PositionSchema = new Schema({ | |
company : String, | |
position : String, | |
summary : String, | |
startDate : Date | |
}); | |
module.exports = mongoose.model('position', PositionSchema); |
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'), | |
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