|
13 | 13 | <section id="description">
|
14 | 14 | <title>Synopsis</title>
|
15 | 15 | <p><link xref="mongoc_read_prefs_t">mongoc_read_prefs_t</link> 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.</p>
|
16 |
| - <p>You can specify a read preference mode on connection objects, database objects, collection objects, or per-operation. Generally, it makes the most sense to stick with *READ_PRIMARY*. All of the other modes come with caveats that won't be covered in great detail here.</p> |
| 16 | + <p>You can specify a read preference mode on connection objects, database objects, collection objects, or per-operation. Generally, it makes the most sense to stick with the global default, <code>MONGOC_READ_PRIMARY</code>. All of the other modes come with caveats that won't be covered in great detail here.</p> |
17 | 17 | </section>
|
18 | 18 |
|
19 | 19 | <section id="read-modes">
|
|
25 | 25 | </tr>
|
26 | 26 | <tr>
|
27 | 27 | <td><p>MONGOC_READ_SECONDARY</p></td>
|
28 |
| - <td><p>All operations read from the secondary members of the replica set.</p></td> |
| 28 | + <td><p>All operations read from among the nearest secondary members of the replica set.</p></td> |
29 | 29 | </tr>
|
30 | 30 | <tr>
|
31 | 31 | <td><p>MONGOC_READ_PRIMARY_PREFERRED</p></td>
|
32 | 32 | <td><p>In most situations, operations read from the primary but if it is unavailable, operations read from secondary members.</p></td>
|
33 | 33 | </tr>
|
34 | 34 | <tr>
|
35 | 35 | <td><p>MONGOC_READ_SECONDARY_PREFERRED</p></td>
|
36 |
| - <td><p>In most situations, operations read from secondary members but if no secondary members are available, operations read from the primary.</p></td> |
| 36 | + <td><p>In most situations, operations read from among the nearest secondary members, but if no secondaries are available, operations read from the primary.</p></td> |
37 | 37 | </tr>
|
38 | 38 | <tr>
|
39 | 39 | <td><p>MONGOC_READ_NEAREST</p></td>
|
40 |
| - <td><p>Operations read from the nearest member of the replica set, irrespective of the member’s type.</p></td> |
| 40 | + <td><p>Operations read from among the nearest members of the replica set, irrespective of the member’s type.</p></td> |
41 | 41 | </tr>
|
42 | 42 | </table>
|
43 | 43 | </section>
|
|
56 | 56 | <item><p>nearest</p></item>
|
57 | 57 | </list>
|
58 | 58 |
|
59 |
| - <p>Tags are not compatible with primary and, in general, only apply when selecting a secondary member of a set for a read operation. However, the nearest read mode, when combined with a tag set will select the nearest member that matches the specified tag set, which may be a primary or secondary.</p> |
| 59 | + <p>Tags are not compatible with <code>MONGOC_READ_PRIMARY</code> and, in general, only apply when selecting a secondary member of a set for a read operation. However, the nearest read mode, when combined with a tag set will select the nearest member that matches the specified tag set, which may be a primary or secondary.</p> |
60 | 60 |
|
61 | 61 | <p>All interfaces use the same member selection logic to choose the member to which to direct read operations, basing the choice on read preference mode and tag sets.</p>
|
62 | 62 | </section>
|
|
0 commit comments