You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/mongo/read_preference.ex
+8-13Lines changed: 8 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -10,20 +10,20 @@ defmodule Mongo.ReadPreference do
10
10
If tag_sets and maxStalenessSeconds are set, they determine which candidate servers are eligible for selection.
11
11
If hedge is set, it configures how server hedged reads are used.
12
12
13
-
The default mode is 'primary'.
13
+
The default mode is `:primary`.
14
14
The default tag_sets is a list with an empty tag set: [{}].
15
15
The default max_staleness_ms is unset.
16
16
The default hedge is unset.
17
17
18
18
## mode
19
19
20
-
* `primary` Only an available primary is suitable.
21
-
* `secondary` All secondaries (and only secondaries) are candidates, but only eligible candidates (i.e. after applying tag_sets and maxStalenessSeconds) are suitable.
22
-
* `primaryPreferred` If a primary is available, only the primary is suitable. Otherwise, all secondaries are candidates,
23
-
but only eligible secondaries are suitable.
24
-
* `secondaryPreferred` All secondaries are candidates. If there is at least one eligible secondary, only eligible secondaries are suitable.
25
-
Otherwise, when there are no eligible secondaries, the primary is suitable.
26
-
* `nearest` The primary and all secondaries are candidates, but only eligible candidates are suitable.
20
+
* `:primary` Only an available primary is suitable.
21
+
* `:secondary` All secondaries (and only secondaries) are candidates, but only eligible candidates (i.e. after applying tag_sets and maxStalenessSeconds) are suitable.
22
+
* `:primary_preferred` If a primary is available, only the primary is suitable. Otherwise, all secondaries are candidates,
23
+
but only eligible secondaries are suitable.
24
+
* `:secondary_preferred` All secondaries are candidates. If there is at least one eligible secondary, only eligible secondaries are suitable.
25
+
Otherwise, when there are no eligible secondaries, the primary is suitable.
26
+
* `:nearest` The primary and all secondaries are candidates, but only eligible candidates are suitable.
27
27
28
28
"""
29
29
@typet::%{
@@ -86,9 +86,4 @@ defmodule Mongo.ReadPreference do
0 commit comments