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