Guest User

Untitled

a guest
Oct 17th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // app.js
  2.  
  3. Mongoose = require('mongoose');
  4. Schema = Mongoose.Schema;
  5. ObjectID = Schema.ObjectId;
  6.  
  7.  
  8. // Booth.js
  9.  
  10. Users = new Schema({
  11.       type: ObjectID
  12.     , ref: 'UserModel'
  13. });
  14.  
  15. Slots = new Schema({
  16.      Name: String
  17.     ,Users: [Users]
  18. });
  19.  
  20. BoothSchema = new Schema({
  21.     Name: String,
  22.     MaxUsers: Number,
  23.     Slots: [Slots]
  24. });
  25.  
  26. BoothModel = Mongoose.model('BoothModel', BoothSchema);
Add Comment
Please, Sign In to add comment