How to Set Path for MongoDB in Windows

To run mongodb binaries without having specified the full path, we need to add mongodb binary location to the windows Path system variable.

Without mongodb Path, we have to type the full path to the binary file as shown below.

"c:\Program Files\MongoDB\Server\3.4\bin\mongo.exe"

First of all you need to identify the location of the bin folder. Mongodb binaries are in the bin folder of the install location. The full path to the mongodb bin directory is something similar to below.

c:\Program Files\MongoDB\Server\3.4\bin

To add mongodb to windows system PATH, Open the Windows control panel, Go to System and Security > System > Advanced system settings and click Environment variables.

(The variables defined under System variables are available for all the users of the system, and User variables are available only to the current user.)

If the Path variable does not exist, click on the New button and add the full path to the mongodb bin directory as shown below.

If the Path variable already exists, select the variable and click Edit button. Then, put a semicolon at the end of the value and append the full path to the mongodb bin directory.