AllenYuan

user schema

May 6th, 2020
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var mongoose = require('mongoose');
  2.  
  3. // schema representing user data
  4. var UserSchema = new mongoose.Schema({
  5.   username: String,
  6.   email: String,
  7.   bio: String,
  8.   image: String,
  9.   hash: String,
  10.   salt: String
  11. }, {timestamps: true});
  12.  
  13. // register the schema with mongoose as 'User'
  14. mongoose.model('User', UserSchema);
Advertisement
Add Comment
Please, Sign In to add comment