Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (50.2k 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 (107k points)
edited by

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.

Do you want to be a full-stack developer? Enroll in this Full Stack Certification to get started with your journey.

Related questions

0 votes
2 answers
0 votes
2 answers
0 votes
1 answer
0 votes
1 answer
asked Feb 7, 2020 in Web Technology by ashely (50.2k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...