0 votes
1 view
in Web Technology by (43k points)

Without changing directory to \MongoDB\bin\, when I call:

mongod -v

I get:

'mongod' is not recognized as an internal or external command, operable

program or batch file.

When I call the same command from \bin\ it launches the server just like I'm calling:

mongod

It is the same case with 'mongo' and 'mongos'.

I added the \bin\ path to the environment variables thinking it will help but it didn't.

To clarify with an example, to get the version of Ruby, I can call:

ruby -v

Why can't I do the same with MongoDB?

1 Answer

0 votes
by (92.1k points)

image

As you can see in the above image if I write mongod --version only I will get the same error but if I go inside my bin folder of mongodb, for me the path is 

cd C:\Program Files\MongoDB\Server\4.2\bin>

Then write mongod --version then it will show me the correct version of MongoDB.

Related questions

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...