Docs Menu

Docs HomeMongoDB Manual

Mongo.setSecondaryOk()

On this page

  • Definition
  • Example
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

See also:

←  Mongo.setReadPref()Mongo.startSession() →

On this page

Share Feedback
© 2023 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2023 MongoDB, Inc.