text: const mongoose = require('mongoose');
  
  mongoose.set('useFindAndModify', false);
  mongoose.set('useCreateIndex', true);
  
  mongoose.Promise = global.Promise;
  
  mongoose.connect(process.env.ATLAS_SRV, { useNewUrlParser: true })
  
  const db = mongoose.connection;
  
  db.on('error', console.error.bind(console, 'connection error:'));
  db.once('open', () => { console.log('db connected') });
  
  module.exports = db;