Guest User

Untitled

a guest
Feb 2nd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. 'use strict';
  2. const mongoose = require('mongoose');
  3. const UserSchema = new mongoose.Schema({
  4. name: String, // full name
  5. create_date: Date, // signup date
  6. email: String, // email == username
  7. password: String, // hashed password
  8. options: {
  9. assistants: {
  10. default: {
  11. enabled: Boolean, // Turn assistant on
  12. },
  13. },
  14. .... (other settings)
  15. },
  16. });
  17.  
  18. module.exports = mongoose.model('User', UserSchema);
  19.  
  20. user:model
  21. $__: internalCache{...}
  22. $init: true
  23. create_date: (...)
  24. email: (...)
  25. errors: undefined
  26. id: (...)
  27. isNew: false
  28. name: (...)
  29. options: model
  30. $init: true
  31. assistants: model
  32. $init: true
  33. create_date: undefined
  34. default: model
  35. $init: true
  36. assistants: undefined
  37. create_date: undefined
  38. email: undefined
  39. enabled: false <= the only real property!
  40. id: undefined
  41. name: undefined
  42. options: undefined
  43. ... etc
  44. email: undefined
  45. id: undefined
  46. name: undefined
  47. options: undefined
  48. password: undefined
  49. ...etc
  50. $__: internalCache{...}
  51. $__isNested: true
  52. email: undefined <= these ones are greyed-out
  53. id: undefined
  54. name: undefined
  55. options: undefined
  56. password: undefined
  57.  
  58. "mongoose": {
  59. "version": "4.11.12",
  60.  
  61. $ mongod --version
  62. db version v3.6.2
  63.  
  64. $ node -v
  65. v9.4.0
Add Comment
Please, Sign In to add comment