Skip to content

Commit 31d6ea1

Browse files
committed
updated documentation
1 parent c341df1 commit 31d6ea1

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

lib/mongo/read_preference.ex

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ defmodule Mongo.ReadPreference do
1010
If tag_sets and maxStalenessSeconds are set, they determine which candidate servers are eligible for selection.
1111
If hedge is set, it configures how server hedged reads are used.
1212
13-
The default mode is 'primary'.
13+
The default mode is `:primary`.
1414
The default tag_sets is a list with an empty tag set: [{}].
1515
The default max_staleness_ms is unset.
1616
The default hedge is unset.
1717
1818
## mode
1919
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.
2727
2828
"""
2929
@type t :: %{
@@ -86,9 +86,4 @@ defmodule Mongo.ReadPreference do
8686

8787
end
8888

89-
defp is_max_staleness_valid?() do
90-
#max_staleness_ms >= heartbeatFrequencyMS + idleWritePeriodMS
91-
#max_staleness_ms >= smallestMaxStalenessSeconds
92-
93-
end
9489
end

0 commit comments

Comments
 (0)