Mongo.getReadPrefTagSet()返回: 为 连接对象设置的当前
Mongo()读取偏好(read preference) 标签集。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() 使用以下操作返回并打印当前读取偏好(read preference)标签集:
printjson(db.getMongo().getReadPrefTagSet());
兼容性
此方法可用于以下环境中托管的部署:
- MongoDB Atlas:用于云中 MongoDB 部署的完全托管服务
MongoDB Enterprise:基于订阅、自我管理的 MongoDB 版本
MongoDB Community:源代码可用、免费使用且可自行管理的 MongoDB 版本