title: Starting Mongod And Mongo From Terminal
body: <p>I would like to clarify a few things with <code>mongodb</code> in my <code>node project</code></p>
  
  <p>I have MongoDb installed and running fine on OSX Mavericks. I can create collections and query them after running mongo in my terminal.</p>
  
  <p>What exactly is mongod doing when running it from the console? </p>
  
  <p>When I run mongod it complains about needing a path to <code>data/db</code> 
  so I run <code>mongod --dbpath data/db</code> and it installs a few files to my <code>db folder</code>
   Once I run it like this it ends with </p>
  
  <pre><code>[initandlisten] dbexit: really exiting now
  </code></pre>
  
  <p>I know this should be open and listening on a port. I cannot figure out why mine does not stay running. even though I clearly state the path to the <code>data/db</code> file. </p>
  
  <p>I installed with with homebrew and the <code>db files</code> are stored at usr/local/var/mongodb </p>
  
  <p>Am I supposed to <code>--dbpath</code> there or the <code>data/db</code> path I create in each node project?</p>
  
  <pre><code>UPDATE
  </code></pre>
  
  <p>I have also found that a homebrew installation will give you a mongod.conf file which sets up a different <code>--dbpath @ usr/local/var/mongodb</code> and it sets your mongodb server to come on at setup. Which is the reasons for errors when running mongod even when specifying a </p>
  
  <pre><code>--dbpath.
  </code></pre>