Advertisement
Guest User

Untitled

a guest
Sep 6th, 2017
469
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. const UserSchema = new Schema({
  2. email: String
  3. isVerified: { default: false, type; Boolean }
  4. accounts: {
  5. ref: 'Account',
  6. type: Schema.Types.ObjectId
  7. }
  8. })
  9.  
  10. const AccountSchema = new Schema({
  11. facebook: {
  12. ref: 'FacebookAccount',
  13. type: Schema.Types.?
  14. },
  15. local: {
  16. ref: 'LocalAccount',
  17. type: Schema.Types.?
  18. },
  19. twitter: {
  20. ref: 'TwitterAccount',
  21. type: Schema.Types.?
  22. },
  23. })
  24.  
  25. const LocalAccount = new Schema({
  26. email: String,
  27. name: String,
  28. phone: String,
  29. password: String,
  30. _user: {
  31. ref: 'User',
  32. type: Schema.Types.ObjectId
  33. }
  34. })
  35.  
  36. {
  37. _id: '12345789',
  38. email: 'turdFerguson@gmail.com',
  39. accounts: {
  40. facebook: { ... }
  41. local: { ... }
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement