title: MongoParseError: Invalid connection string
body: <p>I am trying to connect MongoDB database with this code but when running it I get the error (see the error below after the code). The initial error was in the line where it was resolved by adding <code>useNewUrlParser: true</code> but even after this I still get more errors. I am using MongoDB version 4.0.1. Does anybody know how to resolve this error?</p>
  
  <pre><code>mongoose.connect('User://localhost:27017/User',{ useNewUrlParser: true })
  </code></pre>
  
  <p>Error while running this code:</p>
  
  <blockquote>
    <p>(node:11068) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): MongoParseError: Invalid connection string
        (node:11068) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.</p>
  </blockquote>