MongooseError: Operation `bootcamps.insertOne()` buffering timed out after 10000ms at Timeout.<anonymous>

const fs = require('fs')

const mongoose = require('mongoose')

const colors = require('colors')

const dotenv = require('dotenv')

// load env vars

dotenv.config({ path: './config/config.env'})

// Loading all Models

const Bootcamp = require('./models/Bootcamp')

// Connecting to DB

mongoose.connect(process.env.MONGO_URI, {

    useNewUrlParser: true,

    useCreateIndex: true,

    useFindAndModify: false,

    useUnifiedTopology: true

})

// Reading JSON files

const bootcamps = JSON.parse(fs.readFileSync(`${__dirname}/_data/bootcamps.json`, 'utf-8'))

// Importing data into DB

const importData = async () => {

    try {

        await Bootcamp.create(bootcamps)

        console.log('Data Imported...'.green.inverse)

        process.exit()

    } catch (err) {

        console.error(err)

    }

}

// Deleting data into DB

const deleteData = async () => {

    try {

        await Bootcamp.deleteMany()

        console.log('Data Destroyed...'.red.inverse)

        process.exit()

    } catch (err) {

        console.error(err)

    }

}

if (process.argv[2] === '-i') {

    importData()

} else if(process.argv[2] === '-d') {

    deleteData()

}