- Reference >
- mongo Shell Methods >
- Connection Methods >
- Mongo.setSlaveOk()
Mongo.setSlaveOk()¶
- Mongo.setSlaveOk()¶
For the current session, this command permits read operations from non-master (i.e. slave or secondary) instances. Practically, use this method in the following form:
db.getMongo().setSlaveOk()
Indicates that “eventually consistent” read operations are acceptable for the current application. This function provides the same functionality as rs.slaveOk().
See the readPref() method for more fine-grained control over read preference in the mongo shell.
Thank you for your feedback!
We're sorry! You can Report a Problem to help us improve this page.