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

First, you have to check the version. Two cases will happen: either you have to set up the binary path with the environment variable or check which command is suitable for your version.

If you use the mongo --version of this command and you got the below error 

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

immediately check your environment path whether you have set it up or not till the bin path for your MongoDB software. like the below screenshot. 

If your path has been set up accordingly then check other ways to find the version 
e.g mongod --version

C:\>mongod --version

db version v6.0.4

Build Info: {

    "version": "6.0.4",

    "gitVersion": "44ff59461c1353638a71e710f385a566bcd2f547",

    "modules": [],

    "allocator": "tcmalloc",

    "environment": {

        "distmod": "windows",

        "distarch": "x86_64",

        "target_arch": "x86_64"

    }

}






















For example, if you are using version 4.xx then the mongo command will support and start your MongoDB server accordingly. In the case of your latest version, 6 .xx. you have to run the mongosh command to start the MongoDB server. But before running the command mongosh in CMD or any shell editor first you have to install the mongosh (https://www.mongodb.com/docs/mongodb-shell/) and set up your till bin path in an environment variable also.

Below the screen shows that run the command mongosh for V6+














Cheers !!!

Comments