Join us at MongoDB.local London on 7 May to unlock new possibilities for your data. Use WEB50 to save 50%.
Register now >
Docs Menu
Docs Home
/ /
Connection Methods

Mongo.setSecondaryOk()

Mongo.setSecondaryOk()

Allows read operations on secondary members for the MongoDB connection.

Also means that eventually consistent read operations are acceptable for the current application. See readPref() for additional fine-grained settings for the read preference.

This example calls setSecondaryOk():

db.getMongo().setSecondaryOk()

Tip

Back

Mongo.setReadPref()

On this page