17

I was trying to download mongoDB on my windows computer. I am very new to this.

C:\mongodb\bin>mongod --directoryperdb --dbpath C:\mongodb\data\db --logpath 
C:\mongodb\mongodb.log --logappend --rest --install 

But it was showing the error as on the title. I just started mongoDB and was trying to learn it through tutorials, but now I am stuck.

KARTHIKEYAN.A
  • 18,210
  • 6
  • 124
  • 133
Sabbir Ridwan
  • 173
  • 1
  • 1
  • 5

3 Answers3

27

The --rest parameter was removed in MongoDB 3.6 as described in this page: MongoDB Configuration Hardening and this ticket: SERVER-29000.

Remove the --rest option from your command line.

kevinadi
  • 13,365
  • 3
  • 33
  • 49
  • for me removing --rest worked but i also needed to add: ```mongod --bind_ip localhost,``` as mongo 3.6 only listens to localhost by default now – oneklc Mar 21 '18 at 18:56
2

Just Install MongoDb and go to the bin folder and run mongo using cmd to start the server. By default, data will be stored to c:\data\db (create a folder).

Also if you have gitbash installed you can set aliases to run using gitbash.

Run following command:

cd~
touch .bash_profile
vi .bash_profile

now it will open vim editor press i and type:

alias mongod="/c/Program\ files/MongoDB/Server/{version}/bin/mongod.exe"
alias mongo="/c/Program\ Files/MongoDB/Server/{version}/bin/mongo.exe"

remember to replace {version} with your installed version.

Press esc and type :wq! and press enter to exit.

Now you can run mongo and mongod commands from any directory on gitbash.

0

I removed the --rest parameter but it doesn't work. After I run "net start MongoDB", it gaves me this message: "The service is not responding to the control function.

More help is available by typing NET HELPMSG 2186"