How to install specific MongoDB Version

Generally to install MongoDB we use the following command.

If you want to install specific version of mongodb, for example if you want install 3.4.0 version you can use the following command.

In the same way if we want to install any version of mongodb we can use this format.

Solution: zsh: command not found: mongod

If MongoDB is not installed properly in the system, then this error comes on command prompt. To fix this problem follow the below steps.

Try to install MongoDB by using Homebrew. Before that ensure Homebrew is installed or not by using the following command.

If Homebrew is not installed, install it. After completion of Homebrew installation, Add MongoDB to Homebrew’s list of packages by using the following command.

Install the latest version of MongoDB with the following command.

Now check with the command mongod in the command prompt. Now it won’t show the error message as command not found.