How to open mongo shell


I have installed mongo db enterprise edition on my windows machine.

How do I open mongo db shell and connect to “mongo “mongodb://,,” --authenticationDatabase admin --ssl -u m121 -p aggregations --norc”.

Also, why do we need to install mongo enterprise edition for this course ? Don’t we only need mongo shell to connect to remote mongo server ?

Ajay Parmar

Are you still facing issues connecting to your DB?
Just open Windows cmd prompt and run your connect string

You don’t need Entp. edition just shell should be sufficient
You can use it for your local testing/research since you have already installed

1 Like

Yes i am still facing issue. It is not able to find mongo command. Do i need to add any system variables ?

I am able to connect now. I had to run this from C:\Program Files\MongoDB\Server\5.0\bin folder.

Hi @Ajay_parmar1, you can also follow the instructions given here to run the command from any directory:

Make the DB Tools available in your PATH:

  1. Open the Control Panel.
  2. In the System and Security category, click System.
  3. Click Advanced system settings. The System Properties modal displays.
  4. Click Environment Variables.
  5. In the System variables section, select Path and click Edit. The Edit environment variable modal displays.
  6. Click New and add the filepath to the location where you copied the Database Tools.
  7. Click OK to confirm your changes. On each other modal, click OK to confirm your changes.

Once set, you can run any of the Database Tools directly from your command prompt. Consult the reference page for the specific tool you wish to use for its full syntax and usage.

In case you have any doubts, please feel free to reach out to us.

Thanks and Regards.
Sourabh Bagrecha,
Curriculum Services Engineer

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.