A string describing the read preference mode (primary|primaryPreferred|secondary|secondaryPreferred|nearest)描述读取首选项模式的字符串(primary
|primaryPreferred
|secondary
|secondryPreferred
|nearest
)
A tag set used to target reads to members with the specified tag(s). 一个标记集,用于将读取目标指向具有指定标记的成员。tagSet is not available if using read preference mode primary.如果使用读取首选项模式,则tagSet不可用。
Additional read preference options其他读取首选项
Check if the two ReadPreferences are equivalent检查两个ReadPreferences是否等效
The read preference with which to check equality用于检查相等性的读取首选项
Validate if a mode is legal验证模式是否合法
The string representing the read preference mode.表示读取首选项模式的字符串。
Indicates that this readPreference needs the "SecondaryOk" bit when sent over the wire指示此readPreference在通过网络发送时需要“SecondaryOk”位
Indicates that this readPreference needs the "secondaryOk" bit when sent over the wire指示此readPreference在通过网络发送时需要“secondaryOk”位
Return JSON representation返回JSON表示
Construct a ReadPreference given an options object.构造给定选项对象的ReadPreference。
The options object from which to extract the read preference.从中提取读取首选项的选项对象。
Validate if a mode is legal验证模式是否合法
The string representing the read preference mode.表示读取首选项模式的字符串。
Replaces options.readPreference with a ReadPreference instance将options.readPreference
替换为ReadPreference
实例
Generated using TypeDoc
The ReadPreference class is a class that represents a MongoDB ReadPreference and is used to construct connections.ReadPreference类是表示MongoDB ReadPreferent的类,用于构造连接。https://docs.mongodb.com/manual/core/read-preference/