Advertisement
Guest User

Untitled

a guest
Mar 6th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. // im getting TypeError: mongoose.Schema is not a function and i havent found solution for it yet on google soooo
  2.  
  3. const mongoose = require('mongodb');
  4.  
  5. // user stuff
  6. const UserSchema = mongoose.Schema({
  7. name:{
  8. type: String,
  9. required: true
  10. },
  11. email:{
  12. type: String,
  13. required: true
  14. },
  15. username:{
  16. type: String,
  17. required: true
  18. },
  19. password:{
  20. type: String,
  21. required: true
  22. },
  23. });
  24.  
  25. const User = module.exports = mongoose.model('User', UserSchema);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement