Advertisement
Guest User

Untitled

a guest
Aug 1st, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var skillSchema = new mongoose.Schema({
  2.     name:String,
  3.     desc:String,
  4.     tags:[{
  5.         name:String,
  6.         rating:Number
  7.     }],
  8.     dateAdded:{type:Date,default:Date.now()},
  9.     user:String
  10. }, { collection: 'Skills' });
  11.  
  12. var skillSchema = new mongoose.Schema({
  13.     name:String,
  14.     numUsed:{type:Number,default:0}
  15. }, { collection: 'Tags' });
  16.  
  17.  
  18. var usrSchema = new mongoose.Schema({
  19.     name: String, //(user)name of the user,
  20.     first:String, //first name, for things
  21.     last:String,//last name, for more things
  22.     pass: String,
  23.     salt: String,
  24.     jobTitle:String,
  25.     creationDate:Date,
  26.     city:String,
  27.     state:String,
  28.     email:String,//email, required for pwd reset
  29.     //all fields below here are optional, and are used to construct the resume.
  30.     phone:String,
  31.     summary:String,//self-written summary of user,
  32.     //skills, each with an (optional!) number of yrs experience
  33.     skills:[{
  34.         id:String,
  35.         yrs:Number
  36.     }],
  37.     //work, with start, end, position,company name. "other" is used for any additonal info that might be relevant.
  38.     work:[{
  39.         start:Date,
  40.         end:Date,
  41.         cName:String,
  42.         position:String,
  43.         other:String,
  44.         loc:String
  45.     }],
  46.     //education. Generally same as above.
  47.     edu:[{
  48.         start:Date,
  49.         end:Date,
  50.         sName:String,
  51.         degree:String,
  52.         other:String
  53.     }],
  54.     //other experience
  55.     exp:[{
  56.         start:Date,
  57.         end:Date,
  58.         eName:String,
  59.         pos:String,
  60.         desc:String
  61.     }]
  62. }, { collection: 'User' });
  63.  
  64. usrSchema.plugin(passportLocalMongoose,{
  65.     usernameField:'name',
  66.     hashField:'pass',
  67.     lastLoginField:'lastLogin'
  68. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement