Last active
May 11, 2022 03:46
-
-
Save Rishabh570/79b106bec5f420bfa7da1088cc35f3a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
// Schema to store the information about other logged in accounts | |
const accountSchema = new Schema({ | |
name: String, | |
userId: String, | |
email: String | |
}); | |
// create User Schema | |
var UserSchema = new Schema({ | |
name: String, | |
connectedSocialAccounts: { | |
type: Number, | |
default: 1 | |
}, | |
otherAccounts: [accountSchema], | |
google: { | |
accessToken: String, | |
email: String, | |
profileId: String, | |
}, | |
github: { | |
accessToken: String, | |
email: String, | |
profileId: String, | |
}, | |
facebook: { | |
accessToken: String, | |
email: String, | |
profileId: String, | |
} | |
}); | |
const User = mongoose.model('users', UserSchema); | |
module.exports = User; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment