Guest User

Untitled

a guest
Nov 2nd, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. const mongoose = require('mongoose');
  2.  
  3. // *** NOTE: You never want to store a plain password in production! If someone gains access to your database, they will have access to all the users passwords.
  4. // You can use something like PassportJS to handle saving passwords
  5. const UserSchema = new mongoose.Schema({
  6. username: {
  7. type: String,
  8. default: '',
  9. },
  10. password: {
  11. type: String,
  12. default: '',
  13. },
  14. email: {
  15. type: String,
  16. default: 'N/A',
  17. },
  18. registerDate: {
  19. type: Date,
  20. default: Date.now(),
  21. },
  22. });
  23.  
  24. module.exports = mongoose.model('User', UserSchema);
Add Comment
Please, Sign In to add comment