j ton
j ton

Reputation: 239

.mongo' is not recognized as an internal or external command, operable program or batch file=> add path isn't working for me

I do read through
.mongo' is not recognized as an internal or external command, operable program or batch file
https://youtu.be/6_NSkDRXPZk?t=227

they said really clear need to add path in "environment variable"
However is still not work

following I detailed my steps(sorry for using 3 screenshot, otherwise I don't know how to present instead of code only )

checking mongoDB path: C:\Program Files\MongoDB\Server\6.0\bin mongoDB path

adding path in environment variable adding path in environment variable01 adding path in environment variable02

but the result when I check the mongoDB version :  result when I check the mongoDB version

C:\Users\chuan>mongo --version 'mongo'
不是內部或外部命令、可執行的程式或批次檔。

means

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

Upvotes: 0

Views: 717

Answers (1)

j ton
j ton

Reputation: 239

I solved -

If there is no mongo.exe in your bin file, then download the mongo shell - mongosh from here

Use mongosh instead of mongo in the command line.

Check this Answer from dododo : "mongo shell no longer ships with server binaries."

Open "cmd" and type "mongod --version" in place of "mongo --version".

C:\Users\chuan>mongod --version
db version v6.0.2
Build Info: {
    "version": "6.0.2",
    "gitVersion": "94fb7dfc8b974f1f5343e7ea394d0d9deedba50e",
    "modules": [],
    "allocator": "tcmalloc",
    "environment": {
        "distmod": "windows",
        "distarch": "x86_64",
        "target_arch": "x86_64"
    }
}

Upvotes: 0

Related Questions