title: Mongodb cluster and reading from secondary when primary is down
body: <p>This is not a basic question on just asking about mongo cluster. It is not a duplicate in my opinion
  I have a mongodb 3 node cluster and my url is something along the following lines in a PlayFramework conf file</p>
  
  <pre><code>mongodb.uri = "mongodb://mongodb1:27017,mongodb2:27017,mongodb3:27017/myproj"
  </code></pre>
  
  <p>By default when the replica is configured, all reads and writes are happening only on Primary and that is what I want. I however, want the reads to go to secondary when no primary is left, that is when 2 nodes go down, there will not be a primary left and only one secondary. </p>
  
  <p>I do not want to modify my code to achieve this for each read query. I tried the following on the secondary node but it does not help</p>
  
  <pre><code>db.getMongo().setReadPref('primaryPreferred')
  </code></pre>
  
  <p>What exactly do I need to do to make this work?</p>