Node.js: Accessing the MongoDB Database using Node.js for Performing CRUD Operations with Async/Await Approach
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj44XnCxrgSiXnUc9oMIxAbo3oMCewc5NQt7jz-hxCCY-j9fI9Luyaaf7kYn7LQh6kTQkHL32c8ipsdVM3odCmch_awJ2g4Z-5LVmYjL9dh9bY-H7EZJTgRxDIOXZA_Y5pKOHehOfBGmP5Fh93qpemwulgTwfTfKm4Qmpbd9sk6bwPnh9kmvmWIgo6p0pY/s16000/Figure-1-MongoDB-Database-and-Collection.png)
In this article, we will understand an approach for building a Node.js application for performing CRUD Operations by accessing the MongoDB database. In recent days I have come across several requirements from students regarding the MEAN and MERN JavaScript full-stack applications. Considering such a frequent requirement from my students I thought to write a post on it for the latest version of Node.js, MongoDB, and Mongoose packages. The Node.js can be downloaded from the following link https://www.nodejs.org The MongoDB Can be downloaded from the following link https://www.mongodb.com/try/download/community The code for this article is written using Microsoft Visual Studio Code (VSCode). Step 1: Open Command Prompt (or Terminal Window) and create a new folder named node-api. Open this folder in VS Code. Step 2: Run the following commands to create a generate package.json file for the project npm init -y After generating package.json, run the following command to install Express, M