Read preference.
More...
#include <userver/storages/mongo/options.hpp>
◆ Mode
Enumerator |
---|
kPrimary | read from primary, default mode
|
kSecondary | read from secondary
|
kPrimaryPreferred | read from primary if available, fallback to secondary
|
kSecondaryPreferred | read from secondary if available, fallback to primary
|
kNearest | read from any host with the lowest latency
|
Definition at line 29 of file options.hpp.
◆ AddTag()
Adds a tag to the tag set.
- Note
- Cannot be used with kPrimary mode.
◆ SetMaxStaleness()
ReadPreference & storages::mongo::options::ReadPreference::SetMaxStaleness |
( |
std::optional< std::chrono::seconds > |
max_staleness | ) |
|
Sets maximum replication lag for eligible replica.
- Note
- Must be at least 90 seconds, cannot be used with kPrimary mode.
The documentation for this class was generated from the following file: