rest-hapi.js
function mongooseInit(mongoose, logger, config) {
  const Log = logger.bind('mongoose-init')

  mongoose.Promise = Promise

  logUtil.logActionStart(
    Log,
    'Connecting to Database',
    _.omit(config.mongo, ['pass'])
  )

  mongoose.connect(config.mongo.URI)

  globals.mongoose = mongoose

  Log.log('mongoose connected')

  return mongoose
}
function mongooseInit(mongoose, logger, config) {
  const Log = logger.bind('mongoose-init')

  mongoose.Promise = Promise

  logUtil.logActionStart(
    Log,
    'Connecting to Database',
    _.omit(config.mongo, ['pass'])
  )

  mongoose.connect(config.mongo.URI)

  globals.mongoose = mongoose

  Log.log('mongoose connected')

  return mongoose
}
function mongooseInit ( mongoose , logger , config ) { const Log = logger . bind ( 'mongoose-init' ) mongoose . Promise = Promise logUtil . logActionStart ( Log , 'Connecting to Database' , _ . omit ( config . mongo , [ 'pass' ] ) ) mongoose . connect ( config . mongo . URI ) globals . mongoose = mongoose Log . log ( 'mongoose connected' ) return mongoose }
Connect mongoose and add to globals.
@param mongoose
@param logger
@param config
@returns {*}
Connect mongoose and add to globals .