I’m finding it hard to download MongoDB in the background. I’m successful with the command:
brew services start firstname.lastname@example.org ,
but every time i try the command:
mongod –config /usr/local/etc/mongod.conf –fork,
bash: mongod: command not found.
brew services list
works and runs the following:
Name Status User File
email@example.com started myName ~/Library/LaunchAgentsfirstname.lastname@example.org
However, when I run:
mongod –config /usr/local/etc/mongod.conf –fork
bash: mongod: command not found
I am quite new to Computer Science and I only got recently acquainted with the Terminal so be nice!
mongod is not found,
/usr/bin/mongod – or wherever it is installed – should work.
Typically when you install a service, then you don’t need to start it.
brew services start email@example.com should be automatically executed when you boot the computer, I think this it at least the default behaviour.
When it runs then you cannot execute
mongod --config /usr/local/etc/mongod.conf – you cannot start mongod multiple times (unless you use a different config file with different
brew services start firstname.lastname@example.org and
mongod --config /usr/local/etc/mongod.conf are the same. With
mongod ... you just get a terminal window staying open, while
brew services start runs in background.