Advertisement
Guest User

SchemaManager

a guest
Jul 4th, 2018
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class SchemaManager {
  2.  
  3.     constructor() {
  4.         var schemaUser = new mongoose.Schema({ username: 'string', name: 'string', email: 'string', password: 'string', emploiNow: 'string', picture: 'string', formation: 'string', listLastEmploy: 'array', description: 'string', listCompetence: 'array', listInterest: 'array' , friendList:'array'}, { collection: 'Users' });
  5.         this.modelUser = mongoose.model('Users', schemaUser);
  6.  
  7.         var schemaMessage = new mongoose.Schema({ userName: 'string', conversations: ['array']}, { collection: 'userMessage' });
  8.         this.modelMessage = mongoose.model('userMessage', schemaMessage);
  9.  
  10.         var schemaNotification = new mongoose.Schema({ userMail: 'string', listNotification: 'array'}, { collection: 'notificationSystem' });
  11.         this.modelNotification = mongoose.model('notificationSystem', schemaNotification);
  12.  
  13.         var schemaUserVisits = new mongoose.Schema({ userName: 'string', listUserVisit: [{ name: 'string' }, { date: 'date' }], listVisitedByUser: [{ name: 'string' }, { date: 'date' }] }, { collection: 'userVisits' });
  14.         this.modelVisits = mongoose.model('userVisits', schemaUserVisits);
  15.  
  16.         var schemaOffers = new mongoose.Schema({owner: 'string', nameOffer:'string', description:'string', date:'string', compSearched: 'array', enterprise:'string'}, {collection: 'proOffers'})
  17.         this.modelOffers = mongoose.model('proOffers', schemaOffers);
  18.  
  19.         var schemaChatLog = new mongoose.Schema({ users : 'array', conversations: ['array']}, { collection: 'chatLog' });
  20.         this.modelChatLog = mongoose.model('userMessageBis', schemaChatLog);
  21.     }
  22.  
  23.  
  24. }
  25.  
  26. const instance = new SchemaManager();
  27. module.exports = instance;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement