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

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.


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.