Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error parsing command line : unrecognized option '--rest'

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.

like image 771
Sabbir Ridwan Avatar asked Dec 26 '17 20:12

Sabbir Ridwan


2 Answers

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.

like image 60
kevinadi Avatar answered Oct 20 '22 14:10

kevinadi


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.

like image 2
Sarthak Dwivedi Avatar answered Oct 20 '22 13:10

Sarthak Dwivedi