'use strict'

const mongoose = require('mongoose')
const logger = require('winston')
const config = require('../config')
const userSchema = require('./Users')

mongoose.Promise = global.Promise

mongoose.connect(`${config.mongodb.uri}`, {
  useMongoClient: true
}).then(() => logger.info('Successfully connected to database!'))
  .catch((e) => logger.error(e))

const models = {
  Users: mongoose.model('Users', userSchema, 'Users')
}

module.exports = models

@@ -151,16 +151,54 @@
 /Users')
+%0Aconst wearSchema = require('./Wears')
 %0A%0Amongoo
@@ -463,16 +463,71 @@
 'Users')
+,%0A  Wears: mongoose.model('Wears', wearSchema, 'Wears')
 %0A%7D%0A%0Amodu

fix mongooge.js