var UserSchema = new Schema({ name: { type: String, default: '' }, email: { type: String, default: '' }, provider: { type: String, default: '' }, hashed_password: { type: String, default: '' }, salt: { type: String, default: '' }, authToken: { type: String, default: '' }, facebook: {}, linkedin: {} })
I use the scheme mentioned above for my user collection.
and when a new user wants to register using either a local strategy or social strategies
I just use the mongoose update function with the "upsert: true" option to either update or
create a record.
source share