title: DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0，use `openUri()` instead, or set the `useMongoClient`
body: <p>I use the MongoDB in my Node.js project, when I run <code>node app.js</code> in my project there comes an issue like bellow:</p>
  
  <blockquote>
    <p>DeprecationWarning: <code>open()</code> is deprecated in mongoose >= 4.11.0，use <code>openUri()</code> instead, or set the <code>useMongoClient</code> option if using <code>connect()</code> or <code>createConnection()</code></p>
  </blockquote>
  
  <p>My core codes:</p>
  
  <pre><code>var mongoose = require('mongoose')
  mongoose.connect('mongodb://localhost/test');
  var db = mongoose.connection
  
  db.on('error', console.error.bind(console, 'connect error:'));
  db.once('open', function() {
      console.log('connect success');
  })
  </code></pre>