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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With