Mongo.getReadPrefTagSet()

  • Mongo.getReadPrefTagSet()

Returns:The current read preference tag set for theMongo() connection object.

See Read Preference for an introduction to readpreferences and tag sets in MongoDB. UsegetReadPrefTagSet() to return the current readpreference tag set, as in the following example:

  1. db.getMongo().getReadPrefTagSet()

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

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

See also

Read Preference,readPref(), setReadPref(), andgetReadPrefTagSet().