Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (50.2k points)

When I write mongo for switching to the database, it is throwing me the error as:

 error 'mongo' is not recognized as an internal or external command, operable program or batch file

I am not able to understand why it is giving me the error as my mongo shell is connected to the database and I have also inserted 2 documents.

1 Answer

0 votes
by (107k points)
edited by

I think you have not added your mongo.exe to the PATH. Refer to the following steps for adding to the path:

  1. Find your installed MongoDB bin folder and then copy your bin folder path.
  2. Then go to My Computer then Properties then Advanced system settings then Environment Variables then System variables then see for "Path". Then click on Edit then click on New. There you have to paste your copied path to the MongoDB bin folder.
  3. Then at last just restart your mongo shell.
Do you want to be a full-stack developer? Enroll in this Full Stack Certification to get started with your journey.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...