Guest User

Untitled

a guest
Oct 28th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. var userSchema = mongoose.Schema ({
  2. local: {
  3. username: String,
  4. email: String,
  5. gender: String,
  6. firstName: String,
  7. lastName: String,
  8. password: String
  9. },
  10. facebook: {
  11. id: String,
  12. token: String,
  13. email:String,
  14. name: String,
  15. photo: String
  16. },
  17. generalInfo: {
  18. age: String,
  19. favoriteDog: String,
  20. gender: String
  21. }
  22. });
  23.  
  24. User.findOne({'facebook.id': req.user.facebook.id}, function (err, user) {
  25.  
  26.  
  27. // this is info from input from client side form that I want to save in generalInfo property
  28. user.generalInfo.age = req.body.age;
  29. user.generalInfo.gender = req.body.gender;
  30. user.generalInfo.favoriteDog = req.body.favoriteDog
  31.  
  32. });
Add Comment
Please, Sign In to add comment