title: How to pass options in mongoose.connect()
body: <pre><code>DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, 
  pass option { useNewUrlParser: true } to MongoClient.connect.
  (node:11212) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
  </code></pre>
  
  <p>I am using Mongoose but I need to pass to options :</p>
  
  <ol>
  <li>{ useNewUrlParser: true }</li>
  <li>{ useUnifiedTopology: true }</li>
  </ol>
  
  <p>but when I pass both it gives an error.</p>
  
  <pre><code>C:\Users\aA\Desktop\database pro\FruitsProject\node_modules\mongoose\lib\connection.js:585
      throw new MongooseError('3rd parameter to `mongoose.connect()` or ' +    ^Error [MongooseError]: 3rd parameter to `mongoose.connect()` or `mongoose.createConnection()` must be a function, got "object"
      at new MongooseError (C:\Users\aA\Desktop\database pro\FruitsProject\node_modules\mongoose\lib\error\mongooseError.js:10:11)    at NativeConnection.Connection.openUri (C:\Users\aA\Desktop\database pro\FruitsProject\node_modules\mongoose\lib\connection.js:585:11)    at Mongoose.connect (C:\Users\aA\Desktop\database pro\FruitsProject\node_modules\mongoose\lib\index.js:333:15)
      at Object.&lt;anonymous&gt; (C:\Users\aA\Desktop\database pro\FruitsProject\app.js:5:10)    at Module._compile (internal/modules/cjs/loader.js:1158:30)    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)    at Module.load (internal/modules/cjs/loader.js:1002:32)
      at Function.Module._load (internal/modules/cjs/loader.js:901:14)    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
      at internal/main/run_main_module.js:18:47 {  message: '3rd parameter to `mongoose.connect()` or `mongoose.createConnection()` must be a function, got "object"',  name: 'MongooseError'}
  </code></pre>