Hi. Im working on MongoDB, I am using a passport and nodejs, with express. I would like the user to be able to modify the user’s own profile. However, with findAndModify, it will overwrite whatever was in the profile, with the profile downloaded from the strategy. Is there an option or something built in that allows me to do this?
passport.use(new GoogleStrategy({
returnURL: 'http://localhost:3000/auth/google/return',
realm: 'http://localhost:3000/'
},
function(identifier, profile, done) {
accounts.findAndModify({ openID: identifier },{},
{ openID:identifier, profile:profile},
{update:true, upsert:true, new:true}, function (err, user) {
return done(err, user);
});
}
));