Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const UserSchema = new Schema({
- email: String
- isVerified: { default: false, type; Boolean }
- accounts: {
- ref: 'Account',
- type: Schema.Types.ObjectId
- }
- })
- const AccountSchema = new Schema({
- facebook: {
- ref: 'FacebookAccount',
- type: Schema.Types.?
- },
- local: {
- ref: 'LocalAccount',
- type: Schema.Types.?
- },
- twitter: {
- ref: 'TwitterAccount',
- type: Schema.Types.?
- },
- })
- const LocalAccount = new Schema({
- email: String,
- name: String,
- phone: String,
- password: String,
- _user: {
- ref: 'User',
- type: Schema.Types.ObjectId
- }
- })
- {
- _id: '12345789',
- email: 'turdFerguson@gmail.com',
- accounts: {
- facebook: { ... }
- local: { ... }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement