Sunday, April 6, 2014

How to enable "--rest" option in Mongo DB after installation

Many people install the mongo db either as a service or instance but they forget to enable the default rest interface that mongo db provides.
Well to enable rest interface in mongo db as instance is nothing but just stop the instance and re-run the instance with "--rest" option.
i.e. E:\mongodb\bin\mongod.exe --rest --logpath E:\mongoData\log\mongo.log --dbpath E:\mongoData\data\db

But when you install the mongo db as service the how to enable rest interface without creating new service.
  1. Stop the mongo db service.
  2. Open run (window key+r), type regedit (i.e. open registry to edit).
     
  3. In the registry editor, go to the HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Services -> MongoDB
     
  4. Now double click on ImagePath and add the --rest option in the value.
  5. Click Ok.
  6. Exit regedit and start the mongo db service.

No comments:

Post a Comment