title: I'm having some trouble while setting MongoDB to run on the cloud
body: <p>I'm new to Node.Js and all of its &quot;accessories&quot;, and I've been trying to set up a Mongodb database, but there are so many ways to do it, it seems, that I've been quite stuck because I'm not sure what goes where and when, anyway, I have a snapshot of the code and the prompt, everything else on the code works.</p>
  <p><a href="https://i.stack.imgur.com/yZWWf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yZWWf.png" alt="enter image description here" /></a></p>
  <p>Also I want to use the mongo cloud database while hosting my node.js on heroku (I got the heroku deployment running), so would I be able to test my database both when doing &quot;node app.js&quot; on my local machine and when I deploy it on heroku?</p>
  <p><strong>Additional information</strong>:</p>
  <blockquote>
  <p>I NPM'ed mongojs and mongodb</p>
  <p>I'm using some sort of cluster on mongodb.atlas (I'm clueless on this)</p>
  <p>I set up the mongodb shown on the snapshot above using the option: <strong>Clusters &gt; Connect &gt; Connect your application &gt; Short SRV connection string</strong></p>
  </blockquote>