I need to be able to start/stop MongoDB on the CLI. It is quite simple to start:
./mongod
But to stop mongo DB, I need to run open mongo shell first and then type two commands:
$ ./mongo
use admin
db.shutdownServer()
So I don't know how to stop mongo DB in one line. Any help?