Join us Sept 17 at .local NYC! Use code WEB50 to save 50% on tickets. Learn more >
MongoDB Event
Docs Menu
Docs Home
/
MongoDB Manual
/ / /

Mongo.getReadPrefTagSet()

Mongo.getReadPrefTagSet()
Returns:The current read preference tag set for the Mongo() connection object.

See Read Preference for an introduction to read preferences and tag sets in MongoDB. Use getReadPrefTagSet() to return the current read preference tag set, as in the following example:

db.getMongo().getReadPrefTagSet()

Use the following operation to return and print the current read preference tag set:

printjson(db.getMongo().getReadPrefTagSet());

Tip

Back

Mongo.getReadPrefMode()