title: MongoDB error not master and slaveOk=false on primary node with mongoose
body: <p>I'm running a replicated mongoDB and I can connect to the master DB in the set no problem using mongo:</p>
  
  <pre><code>bash-4.2$ mongo --port 25023
  MongoDB shell version: 3.2.6
  rs0:PRIMARY&gt;
  </code></pre>
  
  <p>But when using mongoose like this:</p>
  
  <pre><code>mongoose.connect('mongodb://127.0.0.1:25023/XXX', { useNewUrlParser: true });
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>XXX/node_modules/mongoose/lib/utils.js:452       
  throw err;
      ^
  MongoError: not master and slaveOk=false
     at queryCallback (/XXX/node_modules/mongodb-core/lib/cursor.js:247:25)
  </code></pre>
  
  <p>The suggestion was to do this:</p>
  
  <pre><code>mongodb://user:password@host:port,replicaSetHost:replicaSetPort/database?replicaSet=rs-someServer.
  </code></pre>
  
  <p>But that is a bit unwieldly. Is there no way to tell mongoose we are connecting to a master server and not a slave?</p>
  
  <p>Second problem ... Even listing the other hosts didn't work:</p>
  
  <pre><code>mongoose.connect('mongodb://localhost:P,S1:P,S2:P/XXX?replicaSet=rs0', { useNewUrlParser: true });
  </code></pre>
  
  <p>I get this error even though I supplied the replicaSet:</p>
  
  <pre><code>(node:13757) UnhandledPromiseRejectionWarning: Unhandled promise rejection  (rejection id: 1): MongoError: seed list contains no mongos proxies, replicaset connections requires the parameter replicaSet to be supplied in the URI or options object, mongodb://server:port/db?replicaSet=name
  </code></pre>
  
  <p>Here is where it gets strange: I CAN make this work. If I use this line:</p>
  
  <pre><code>mongoose.connect('mongodb://127.0.0.1:25023/XXX', { useNewUrlParser: true });
  </code></pre>
  
  <p>And let it fail, and then touch a JS file forcing a NodeJS restart, then it seems to start working?</p>