Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var userSchema = mongoose.Schema ({
- local: {
- username: String,
- email: String,
- gender: String,
- firstName: String,
- lastName: String,
- password: String
- },
- facebook: {
- id: String,
- token: String,
- email:String,
- name: String,
- photo: String
- },
- generalInfo: {
- age: String,
- favoriteDog: String,
- gender: String
- }
- });
- User.findOne({'facebook.id': req.user.facebook.id}, function (err, user) {
- // this is info from input from client side form that I want to save in generalInfo property
- user.generalInfo.age = req.body.age;
- user.generalInfo.gender = req.body.gender;
- user.generalInfo.favoriteDog = req.body.favoriteDog
- });
Add Comment
Please, Sign In to add comment