1MONGOC_CURSOR_SET_HINT(3) libmongoc MONGOC_CURSOR_SET_HINT(3)
2
3
4
6 mongoc_cursor_set_hint - mongoc_cursor_set_hint()
7
9 bool
10 mongoc_cursor_set_hint (mongoc_cursor_t *cursor, uint32_t server_id);
11
13 • cursor: A mongoc_cursor_t.
14
15 • server_id: An opaque id identifying the server to use.
16
18 Specifies which server to use for the operation. This function has an
19 effect only if called before the find operation is executed.
20
21 (The function name includes the old term "hint" for the sake of back‐
22 ward compatibility, but we now call this number a "server id".)
23
24 Use mongoc_cursor_set_hint only for building a language driver that
25 wraps the C Driver. When writing applications in C, leave the server id
26 unset and allow the driver to choose a suitable server from the find
27 operation's read preference.
28
30 Returns true on success. If any arguments are invalid, returns false
31 and logs an error.
32
34 MongoDB, Inc
35
37 2017-present, MongoDB, Inc
38
39
40
41
421.17.6 Jun 03, 2021 MONGOC_CURSOR_SET_HINT(3)