Setup MongoDB for Node project

Setup MongoDB for Node project

  1. Go to https://www.mongodb.com and click Try Free button

  2. Click on signup with Google or fill out the given form and accept permission

  3. Fill in the answer to all questions { you can select any options according to your own thought}

  4. You can see an interface like this

    Click on Create button to create a new deployment environment

  5. Select M0 FREE database package as shown below:

    You can also select other Region for better performance

    Give the Name of your Cluster, then click Create

  6. Also, please Create a username and Password of your choice, copy the password, and save it to Notepad for further use

    After copying click on Create User button

    Here click Add My Current IP Address and then Finish and Close

  7. After some time your Cluster will be ready and look like when you click Database at the left bar

  8. After that Click Connect and do following

    • Click MongoDB for VS Code

    • Copy the marked command and close the terminal

  9. Now open the VS code and go to the Extensions to download

  10. Now you can see the symbol of MongoDB at the left sidebar

    • Click Add Connection -> then Connect

    • Paste the copied command from above and replace <password>, then the new command looks like the following

      Press enter. MongoDB connected Successfully

  11. Create Database

    • Click (+) icon and it automatically opens a file

    • Edit the file as follows and run by pressing the play button at the top right corner

Now you can use MongoDB with ease.

THANKS FOR YOUR TIME