You might be the first to run mongodb. Based on the documentation, you have to follow a few steps, and then you are ready to go.
First create the main db directory:
sudo mkdir -p /data/db
Make sure you have read and write permissions in this directory:
sudo chown `id -u` /data/db
And to listen on the default port, run:
mongod
Finally, keep in mind that after running the "mongod" command, do not close the console tab. Open a new tab (Cmd + T) and run other commands in a new window. To close a mongod session, simply press Ctrl + C on the previous tab.
source share