Posts

Showing posts from November, 2023

Node.js: Accessing the MongoDB Database using Node.js for Performing CRUD Operations with Async/Await Approach

Image
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 inst...