Follow these steps to get started with your first mongoDB

  1. npm init
  2. npm install mongoose
  3. npm install dotenv
  4. create config.env file and declare your database string (example: DATABASE=mongodb+srv://abc:abc1234@cluster0.123abc.mongodb.net/test?retryWrites=true&w=majority)
  5. And follow the steps in the index.js file
  6. 'npm run start' to run the function.