title: MongoParseError: Unescaped at-sign in authority section at parseConnectionString
body: <p>I am trying to connect my nodejs application to mongoDB Using mlab but I am getting error which is not understandable for me. </p>
  
  <pre><code>let mongoose=require('mongoose');
  
  const server='ds366482.mlab.com:11275';
  const database='customer_db'
  const user='xyz'
  const password='xyz@5295'
  
  
  mongoose.connect(`mongodb://${user}:${password}@${server}/${database}`, {useNewUrlParser: true})
  
  
  let customerSchema=new mongoose.Schema({
      name:String,
      email:{
          type:String,
          required:true,
          unique:true
      }
  })
  </code></pre>
  
  <p>This is the actual result of my code:</p>
  
  <hr>
  
  <pre><code>server has started on 3000
  (node:4800) UnhandledPromiseRejectionWarning: MongoParseError: Unescaped at-sign in authority section
      at parseConnectionString (/home/admybrand/Desktop/Gaurav's Stuff/rest-api/node_modules/mongodb-core/lib/uri_parser.js:450:21)
      at connect (/home/admybrand/Desktop/Gaurav's Stuff/rest-api/node_modules/mongodb/lib/operations/mongo_client_ops.js:180:3)
      at connectOp (/home/admybrand/Desktop/Gaurav's Stuff/rest-api/node_modules/mongodb/lib/operations/mongo_client_ops.js:284:3)
      at executeOperation (/home/admybrand/Desktop/Gaurav's Stuff/rest-api/node_modules/mongodb/lib/utils.js:420:24)
      at MongoClient.connect (/home/admybrand/Desktop/Gaurav's Stuff/rest-api/node_modules/mongodb/lib/mongo_client.js:168:10)
      at Promise (/home/admybrand/Desktop/Gaurav's Stuff/rest-api/node_modules/mongoose/lib/connection.js:521:12)
      at new Promise (&lt;anonymous&gt;)
      at NativeConnection.Connection.openUri (/home/admybrand/Desktop/Gaurav's Stuff/rest-api/node_modules/mongoose/lib/connection.js:518:19)
      at Mongoose.connect (/home/admybrand/Desktop/Gaurav's Stuff/rest-api/node_modules/mongoose/lib/index.js:270:15)
      at Object.&lt;anonymous&gt; (/home/admybrand/Desktop/Gaurav's Stuff/rest-api/src/models/customer.model.js:9:10)
      at Module._compile (module.js:652:30)
      at Object.Module._extensions..js (module.js:663:10)
      at Module.load (module.js:565:32)
      at tryModuleLoad (module.js:505:12)
      at Function.Module._load (module.js:497:3)
      at Module.require (module.js:596:17)
  (node:4800) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing insideof an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
  (node:4800) [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.
  </code></pre>