title: Connecting to a remote mongoDB server
body: <p>I have a remote machine which I connect to using SSH, I installed mongoDB on it, and I wish to use it remotely, how do I connect to it using nodejs and mongoDB compass? the localhost is the IP ?</p>
  
  <pre><code>const db = "mongodb://what do I write here?";
  const connectDB = async () =&gt; {
    try {
      await mongoose.connect(db, { useNewUrlParser: true, useCreateIndex: true });
      console.log("MongoDB Connected...");
    } catch (err) {
      console.error(err.message);
      process.exit(1);
    }
  };
  connectDB();
  </code></pre>