How to create the first MERN Project

part 1

Connecting MongoDB to a MERN Project

Make sure Node.js and npm are installed on your system by running these commands in the terminal.

npm --version and node --version

  1. Make a directory using the following command in the terminal: mkdir node-mongodb and then navigate into the directory with cd node-mongoDB .

  2. To include a JSON file, you need to run "npm init -y".

  3. The reference picture is attached below how one can write all commands:

  4. A Json file will be there in your directory.

  5. now you have to mention type: module in json file

  6. After this, use the npm command in the terminal to install MongoDB.

    done


Sure, here are the revised steps for working with MongoDB and creating a database:

Now, working with MongoDB, follow the steps below to create a database:


Other parts will be out soon!