A string describing the read preference mode (primary|primaryPreferred|secondary|secondaryPreferred|nearest)描述读取首选项模式的字符串(primary|primaryPreferred|secondary|secondaryPreferred|nearest)。
Optional tags: TagSet[]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不可用。
Optional options: ReadPreferenceOptionsAdditional read preference options其他读取首选项
Optional hedgeOptional maxOptional minOptional tagsStatic NEARESTStatic PRIMARYStatic PRIMARY_Static SECONDARYStatic SECONDARY_Static nearestStatic primaryStatic primaryStatic secondaryStatic secondaryCheck if the two ReadPreferences are equivalent检查两个ReadPreferences是否等效
The read preference with which to check equality用于检查相等性的读取首选项
Static fromConstruct a ReadPreference given an options object.在给定选项对象的情况下构造ReadPreference。
Optional options: ReadPreferenceFromOptionsThe options object from which to extract the read preference.从中提取读取首选项的选项对象。
Static fromStatic isStatic translateReplaces options.readPreference with a ReadPreference instance用ReadPreference实例替换options.readPreference
Generated using TypeDoc
The ReadPreference class is a class that represents a MongoDB ReadPreference and is used to construct connections.ReadPreference类是一个表示MongoDB ReadPreference的类,用于构建连接。See
/v7.0/core/read-preference/