title: How do I set the default connection URL for mongo CLI?
body: <p>I cannot find anywhere to set the default connection URL for the mongo CLI. I want to be able to specify a particular username/password/hostname/database, which can all be specified as a URL. However, I want to just be able to type <code>mongo</code> instead of <code>mongo "mongodb://…"</code> in the shell.</p>
  
  <p>I also don’t want the password to show up in <code>/proc/«PID»/cmdline</code>, but having it in a dotfile in my home directory is perfectly fine with me.</p>
  
  <p>It doesn’t appear that <code>~/.mongorc.js</code> allows specifying the default connection string. But I would expect such an option to be available because the <code>mysql</code> CLI supports <code>~/.my.cnf</code> which allows you to specify username/password/hostname/database. So, where is this for <code>mongodb</code>?</p>
  
  <p>EDIT: The solution has to work even if the <code>mongodb</code> at <code>localhost</code> is fully secured (no insecure local <code>test</code> database should be required—I thought this went without saying).</p>