When I use mongodb, I have to perform two steps to start mongodb.
- start the
mongod
then passdbpath
- then apply mongo command
But instead of that, is there any other way to ignore this step?
When I use mongodb, I have to perform two steps to start mongodb.
mongod
then pass dbpath
But instead of that, is there any other way to ignore this step?
The duplicate question that has been suggested links to mostly outdated answers.
If you install MongoDB 2.6.1 or newer using the MSI download and an Administrator Command Prompt, a service definition should automatically be created for you.
The MongoDB documentation also has a tutorial to help you Manually Create a Windows Service definition if needed.
Why do you need a step 2?
It only launches a mongo client with a user console to connect to the running mongo db process. If you create a linux or windows service don't call mongo
BTW there is such a question already in stack overflow here