- Reference >
- mongo Shell Methods >
- Connection Methods >
- Mongo.getReadPrefMode()
Mongo.getReadPrefMode()¶
- Mongo.getReadPrefMode()¶
Returns: The current read preference mode for the Mongo() connection object. See Read Preference for an introduction to read preferences in MongoDB. Use getReadPrefMode() to return the current read preference mode, as in the following example:
db.getMongo().getReadPrefMode()
Use the following operation to return and print the current read preference mode:
print(db.getMongo().getReadPrefMode());
This operation will return one of the following read preference modes:
See also
Read Preference, readPref(), setReadPref(), and getReadPrefTagSet().
Thank you for your feedback!
We're sorry! You can Report a Problem to help us improve this page.