NovaKevin

organization.js

May 11th, 2018
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Schema = require('mongoose').Schema;
  2. const CallSchema = require('./call');
  3. const TextSchema = require('./text');
  4. const ChatSchema = require('./chat');
  5.  
  6. var OrganizationSchema = new Schema(
  7.     {
  8.         name: {
  9.             type: String,
  10.             required: true
  11.         },
  12.         website: {
  13.             type: String,
  14.             required: true
  15.         },
  16.         contacts: {
  17.             call: {
  18.                 type: [CallSchema],
  19.                 default: void 0
  20.             },
  21.             text: {
  22.                 type: [TextSchema],
  23.                 default: void 0
  24.             },
  25.             chat: {
  26.                 type: [ChatSchema],
  27.                 default: void 0
  28.             }
  29.         }
  30.     },
  31.     { versionKey: false }
  32. );
  33.  
  34. module.exports = OrganizationSchema;
Advertisement
Add Comment
Please, Sign In to add comment