0

Im learning mongoDB and exploring its features, i try several commands when i run the terminal and mongod acts like does not care. It always starts the server even though i simply run for reading help. Some commands that i run

mongod --help

mongod --port 5000

mongod --dbpath C:\myfolder\myproj\data\db 

Everytime, no matter witch i run from the above commands it starts the server always even when searching for help. The port and path do not change also, it looks like it ingores everything other than the mongod in the terminal. Any help?

codewario
  • 19,553
  • 20
  • 90
  • 159
  • which version of mongodb are you running? ``` mongod --version ``` – Daniel Baktiar Apr 27 '22 at 08:46
  • the "mongod --version" command gets ignored same as the above mentioned commands, it goes straight to starting the server. Running "mongo --version" instead works (MongoDB shell version v5.0.6) – Ardit Demiraj Apr 27 '22 at 20:22
  • I see that you are running the WIndows version. Could you try the ```where mongod``` which will give the location of the mongodb binaries? – Daniel Baktiar Apr 28 '22 at 02:26
  • I finally fixed it. When i firstly installed MongoDB i followed an instructor tutorial where he showed how to install it in the MacOS while i was at Windows. I downloaded the msi package for the MongoDB Community Server and the zip versions for MongoDB Shell and MongoDB Database Tools. I did not follow up how to use those zips but i thought extracting them at the same folder installation where the enviroument path was set up as well, as long as they dont overwrite each other should be fine . Accessing all the commands i thought eveything worked but i was wrong. A fresh install fixed it. – Ardit Demiraj Apr 29 '22 at 10:01
  • Thechnically the MongoDB Tools were missing and thats why i could not access the commands in the "mongod" command. – Ardit Demiraj Apr 29 '22 at 10:02

1 Answers1

0

mongod starts the service, but when you close the terminal then also the service terminates.

However, usually you install mongod as a Service. See mongod.exe for details.

Maybe this package will help you: mongoDB-oneClick

Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110