Struct mongo_driver::read_prefs::ReadPrefs
[−]
[src]
pub struct ReadPrefs { /* fields omitted */ }
Provides an abstraction on top of the MongoDB connection read prefences.
It allows for hinting to the driver which nodes in a replica set should be accessed first.
Generally, it makes the most sense to stick with the global default, Primary
. All of the other modes come with caveats that won't be covered in great detail here.
Methods
impl ReadPrefs
[src]
pub fn new(read_mode: &ReadMode) -> ReadPrefs
[src]
Create a new empty read prefs.
pub fn default() -> ReadPrefs
[src]
Get a new instance of the default read pref.