Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. // Require the Mongoose
  2. var mongoose = require('mongoose');
  3.  
  4. // Schema for user
  5. var UserSchema = new mongoose.Schema({
  6. username: {type: String, required: true},
  7. email: {type: String, unique: true, required: true},
  8. password: {type: String, required: true},
  9. });
  10.  
  11. // Compiling the Schema into Model
  12. // First parameter is the name of model,
  13. // and the second parameter is the name of schema.
  14. mongoose.model('User', UserSchema);
  15.  
  16. // as for the mongoose.model above, it can be used when interacting with mongoDB.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement