title: uncaught exception: error: { "$err" : "not master and slaveOk=false", "code" : 13435 }
body: <p>After running <code>db.getMongo().setSlaveOk()</code>; still below error is coming while I am accessing collections from secondery node. As per my understanding I should able see its data from secondary node.</p>
  
  <p><code>uncaught exception: error: { "$err" : "not master and slaveOk=false", "code" : 13435 }</code></p>
  
  <p>I have used below command to create replica set</p>
  
  <pre><code>mkdir D:\data\repdb\One mkdir D:\data\repdb\The mkdir D:\data\repdb\Two mongod --port 27017 --dbpath D:\data\repdb\One --replSet rs0 --smallfiles --oplogSize 128 mongod --port 27018 --dbpath D:\data\repdb\The --replSet rs0 --smallfiles --oplogSize 128 mongod --port 27019 --dbpath D:\data\repdb\Two --replSet rs0 --smallfiles --oplogSize 128 mongo --port 27017 rsconf = { "_id" : "rs0", "version" : 1, "members" : [ { "_id" : 1, "host" : "localhost:27017" } ] }
  
  rs.initiate( rsconf )
  
  rs.conf()
  
  rs.add("localhost:27018") rs.add("localhost:27019")
  </code></pre>